Autoinjection script with custom context path

Hi,

By default dynatrace scripts are injected into head section with root context path like

<script type=“text/javascript” src=“/ruxitagentjs_ICANVfqru_1029924090310435ssd4.js”…>

I was looking in Dynatrace settings where I can define context path so that scripts injected will be with custom context path (/webapp/bio/).

<script type=“text/javascript” src=“/webapp/bio/ruxitagentjs_ICANVfqru_10299240903104354.js”…>

Hi @viveksingh87 ,

You can change it  going to Settings of your application,  Capturing > Advanced setup, RUM monitoring code section and specify path for RUM monitoring code:

Hope it helps.

Regards,

Elena.

Be aware that the path Elena mention does not need to exist, the oneagent will take care of the new path.

Thank you Elena,

I have also tried configuring “/webapp/bio/” under Capturing > Advanced setup and checked application head tag in browser still script does not have context path. Does one agent look for context path from any tag on index.html

<script type=“text/javascript” src=“/ruxitagentjs_ICANVfqru_1029924090310435ssd4.js”…>

Hi @viveksingh87 ,

When you say “Does one agent look for context path from any tag on index.html”, do you mean to place ruxit on index.html? If you mean this, you can define a custom injection rule to inject ruxitagent on index.html:

Regards,

Elena.

I have setup that as below

but even after that script does not prefix context path “/webapp/biometric/”

As a result script failed to download

Hi @viveksingh87 ,

That you’re trying to get is inject ruxit on page “/webapp/bio/” and change the ruxitagent path from “/ruxitagentjs_…js” to “/webapp/bio/ruxitagentjs_…js”, right?

Have you tried to specify the path from RUM monitoring code in Advance Settings and also defining the custom injection rule?

Regards,

Elena.

Yes I have tried that. I have updated the path from RUM monitoring code in Advance Settings and also defined the custom injection rule.

Hi @viveksingh87 ,

If you go to Application > your_app > Settings > Injection, Manual insertion, do you see the desired path?

Something like

<script type=“text/javascript” src="/webapp/bio/ruxitagentjs_ICANVfghqru_10299240903104354.js" data-dtconfig="app=---…</script>

Maybe you have to copy the snippet in your page. As far as I know it shouldn´t required but you can test it.

Or someone can provide a better answer than mine.

Regards,

Elena.