How the JavaScript Agent Works
The JavaScript Agent consists of two files: adrum.js and adrum-ext.js.
- The file adrum.js is injected into each instrumented page, as close to the top as possible, as the page is served. The file loads synchronously at around 90 KB (30 KB with compression).
- This first JavaScript file starts a timer and does some quick configuration and setup.
- At the onload event, adrum-ext.js is fetched asynchronously to prevent blocking the page load. This is the code that does most of the heavy lifting. Once it has been fetched, it is cached for 24 hours on the browser.
- When cross-domain session correlation is enabled, the first time a user visits a domain, the browser additionally loads the file adrum-xd.html to generate or load a piece of common information that enables cross-domain sessions. Future visits will not load adrum-xd.html again.
- When the page has completed loading, the collected data is bundled into a beacon and sent to the EUM Server by adrum-ext.js .
- The data is processed by the EUM Server and then made available for pickup by the Controller.