cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Not a customer? Start a free trial

Click the Start a free trial link to start a 15-day SaaS trial of our product and join our community as a trial user. If you are an existing customer do not start a free trial.

AppDynamics customers and established members should click the sign in button to authenticate.

Knowledge Base

Does the JavaScript Agent for EUM (adrum.js) always need to be placed in the header of the web page?

Question

Does the JavaScript agent for EUM (adrum.js) always need to be placed in the header of the web page? Won't this potentially cause latency and load delays in loading the web page?

 

Answer

Our Engineering team has gone to great lengths to ensure that the initial adrum.js is very lightweight. 

 

Additionally, the loading of adrum.js is synchronous and minimal filesize to prevent page loading interruptions.  It calls out to the extension script, adrum-ext.js, asynchronously to allow rest of the page to load.

 

For most modern browsers, it does not matter where you copy adrum.js file on the page because they support navigation timing, which is what we use for the timings. So loading in the body for them is ok.

 

If you care about accurate timing for older browsers, mostly older IE and Safari, then you need to load the tag as early possible so the fall back timer can be started. 

 

Using the adrum-start-time property gets us around the timing issues with older browsers. Place this JS snippet in the page's <head> and then place adrum.js at the bottom like so window["adrum-start-time"] = new Date().getTime(); More code examples here.

 

IE browsers tips:

  • adrum.js loading placement in relation to <meta> tags definitely impacts pre-IE 9 browsers, therefore the recommended location for adrum.js is AFTER any <meta> tags
  • With older browsers, load adrum.js as early as possible to avoid missing resource timing data
  • Intranet settings in IE can prevent the JS agent from functioning properly
 
Browsers that support the navigation timing API can be found here: Browser Support for Navigation Timing API.
 
Version history
Last update:
‎11-27-2018 04:41 PM
Updated by:
Labels (1)
Tags (2)
By replying you agree to the Terms and Conditions of the AppDynamics Community.
0 Kudos