Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynatrace RUM injection methods

Hi, I've been using Dynatrace RUM to monitor my web application. The application is segregated into multiple micro apps which is handled by different teams. It's a serverless application so we are using manual injection.

After a lot of discussion and consideration around the injection method, we decided to use inline code method to keep the web request minimum and we are using it in async mode in JavaScript tag.


But as mentioned in Dynatrace wiki documentation   as well, this method as maintenance overhead as we need to update the monitoring code every time we make any changes in Dynatrace settings.


I want to understand if i use JavaScript tag method, does it have any major performance implications. I am using Dynatrace managed, so does it everytime go to the server to fetch the script or is there any caching available?

To be honest, I want to use JavaScript tag because it gives us the flexibility to change the settings at anytime because how do i convince others and my developers because apparently, the JS injection method is creating a bit of performance degradation of the page. That is the reason they decided to go ahead with inline code to keep everything in a single file.


Any suggestions or ideas on how I achieve this in a best way? Appreciate in advance.


Best Regards,



DynaMight Guru
DynaMight Guru

Hello @agrawal_shashan 

After a long time, once again I had gone throught the documentation. 

  • According to the documentation, inline is the best option to avoid the performance impact.
  • To reduce the maintenance efferot, the code snippet can be used.
  • There is also a REST API offered.

Please have a look at the below link for more insight:




Hi @Babar_Qayyum Thank you for the quick response. I was looking at the Code Snippet option and it has 2 methods - sync and deferred. We obviously don't want to use Sync because it's render blocking and may affect performance.


Now with the deferred (Async) method, is there a recommended way to to use this? I mean where should we put this in our application html? Since it is deferred, will we loose some kind of monitoring visiblity? Also there is a line which says - "Requires regular snippet updates to guarantee compatibility." What does it mean? Do we need to update the html files everytime we change the settings in Dynatrace?

Let me know if you can advice on this please.

@Babar_Qayyum The reason I asked this is because I tried to change a setting in Advanced set up (cux=1) and it is now asking me to change the code snippet in application. How do i avoid this everytime i make the changes?

Please see the screenshot attached.




Hi @Babar_Qayyum!

Are @agrawal_shashan's hints possible to receive some kind of workaround?

Thank you for feedback in advance!

Hello @agrawal_shashan 

Apologies for the late reply. I am not 100% confident about the best practices but I believe they should be placed at the beginning of each HTML page similar to other codes.

Exactly. The code snipped required a manual update every time to adapt to the changes.



Featured Posts