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

Agentless Real User Monitoring with Code Snippet (defer)

Hello Folks, We have been using Agentless real user monitoring to monitor some of our Single page applications built in Angular. And to avoid the performance impact, we ended up using Code Snippet (defer) format of injection.

I have realised & noticed that in some cases we don't get the relevant data or user actions which we are supposed to get and I think it could be because it's loading asynchronously. I have few questions around Dynatrace RUM which I will highlight below in points. Also wherever I have mentioned documentation, I am referring to here - 

  1. Dynatrace recommends to add the script as early as possible. Does it matter if we do it sync or async? The recommended way is to use the JavaScript tag but that is a sync call and lets say for some reason, call to the cluster active gate is taking longer to response, than that will affect my application to load. How can we avoid this scenario?
  2. If we use Inline Code (jsInlineScript) and manage it using the API as mentioned in the documentation, will that have the same affect as JavaScript tag?
  3. I don't want to loose any monitoring data and neither I want to have a performance impact. Is there a way to achieve this?
  4. As far as I know, there are 2 requests made to Dynatrace in case of RUM, one is to GET the JavaScript Code or monitoring Code and then another is POST to send the data captured from browser. Are both calls sync or just the 1st one?

Any guidance on this is appreciated.

Best Regards,


DynaMight Legend
DynaMight Legend

All great questions @agrawal_shashan. Did you happen to get answers for them. If so could you please share? If not, maybe some other RUM experts can weigh in on the questions.


Dynatrace Helper
Dynatrace Helper

1. If you are using Code Snippet deferred, you'll want to inject the code snippet that you download from the portal as sync and as early as possible. It contains the initialization code and the config data for the RUM JS, and when it makes the call to the RUM JS file from the CAG/CDN, it'll make it a deferred request to prevent render blocking.

2. That API is for inserting the latest version of the tag into your code during application build and should not be used to insert/serve the tag to end users.

3. The Code Snippet Deferred option is the only way to ensure the tag is not render blocking. For those concerned about performance of the tag, utilizing a CDN is recommended (especially when using a Cluster ActiveGate) to ensure proper coverage/scaling

4. The POST back is async and does not block any content, so there is no reason to modify it.

Featured Posts