PDFs


This page applies to an earlier version of the AppDynamics App IQ Platform.
See the latest version of the documentation.


Skip to end of metadata
Go to start of metadata

Sometimes the standard manual injection scenario is not appropriate for your installation.  Use the following options to customize the process for your needs. 

Using a Single Copy of the JavaScript Agent for Multiple Applications

To use the same copy of the JavaScript agent (adrum.js) to cover multiple applications that have multiple application keys, you need to specify the app key for each application by setting up a variable in a small script that precedes the agent script. This is necessary because by default the application key is embedded in the agent script.

To set this up:

1. Download the JavaScript agent. See Download and Include the Agent for general instructions on downloading and including the JavaScript agent  using manual injection.

2. For each of your apps, insert this additional script snippet into the normal JavaScript agent injection script to the header of each page right after the <head> tag (and any <meta> tags), before the entry that includes the location of the agent (adrum.js):

window["adrum-app-key"] = "<app-key-for-this-app>";

The application key for each of your apps is displayed in the relevant  configuration screen under Advanced->Customize your Deployment.

After you include the app key snippet, the start-time snippet, and the agent, the <head> section in your monitored web pages should resemble the following example, although your app key will naturally be different for every app:

<head>
<script>
window["adrum-app-key"] = "AAM-AAB-AUM";
window["adrum-start-time"] = new Date().getTime();
</script>
<script src="/adrum.js"></script>
. . .
. . .
</head>

Enabling Cross Domain Session Correlation

Version 4.2 introduces the idea of Sessions for Browser RUM. In order to use session correlation across domains, you must enable cross domain session correlation.  To do this:

1. Download the JS agent as before.

2. Copy the snippet in Step 3 above and add it before the agent in the injection script.

3. After you include the app key snippet, the start-time snippet, and the agent, the <head> section in your monitored web pages should resemble:

<head>
<script>
<script>(function(config){(function(xd){xd.enable=true;})(config.xd||(config.xd={}));})(window['adrum-config']||(window['adrum-config']={}));</script>
window["adrum-start-time"] = new Date().getTime();
</script>
<script src="/adrum.js"></script>
. . .
. . .
</head>

Using a Cloud Hosted Version of the JavaScript Agent

Instead of using a local version of the JavaScript agent file, it is possible to use one in the Cloud. AppDynamics maintains a hosted copy of the latest version of the main JavaScript agent file, adrum.js, on Amazon CDN. The file is located at:

https://cdn.appdynamics.com/adrum/adrum-latest.js

Previous versions of the agent can be found at:

http://cdn.appdynamics.com/adrum/adrum-VERSION.js

where VERSION is the version number (for example, 3.9.16.0) you want to access.  For versions before 3.8, please contact support.

Use the adrum-latest.js version if you are using a SaaS EUM Cloud and want a hosted version of adrum.js. If you are using an on-prem EUM Server and want to use a hosted version of adrum.js, you need to match the version to the version of your EUM Server.

To use the hosted version of the JavaScript agent (adrum.js) instead of one located on your local system:

1. Open the JavaScript Instrumentation tab.

2. You do not need to download the JavaScript agent.

3. You must specify the app key if you are using the hosted script.  See Using a Single Copy of the JavaScript Agent for Multiple Applications for instructions on doing this.

4. Optional: If you want to use a custom geo-server along with the hosted version of the script, you also need to add a line defining the custom geo URL:

window["adrum-geo-resolver-url"] = "<the URL, including the context root, of your custom geo-server>";

For more information on using a custom geo-server, see Use a Custom Geo Server for Browser RUM.

 

5. Edit the path for the agent, adrum.js, to point to the hosted location on Amazon:

<script src="https://cdn.appdynamics.com/adrum/adrum-latest.js">

After you include the app key, the start-time line, the custom geo-server URL (optional), and the agent URL, the <head> section in your monitored web page should resemble something like this:

<head>
<script>
window["adrum-app-key"] = "AAM-AAB-AUM";
window["adrum-start-time"] = new Date().getTime();//optional
window["adrum-geo-resolver-url"]="https://mygeo.acme.com/geo";
</script>
<script src="https://cdn.appdynamics.com/adrum/adrum-latest.js"></script>
. . .
. . .
</head>

Using a Local Version of the JavaScript Agent Extension

By default the JavaScript agent, adrum.js, that you inject into your page downloads the extension file, adrum-ext.js, from the Cloud.  If you prefer to host this file locally, you need to:

1. Download the JS agent as before.

2. Download the extension by clicking Download the JavaScript Agent Extension. A new tab in your browser opens up with the script.  

3. Save the file in a location accessible to the web page as it is delivered to your user.  Use Save Page As in your browser to capture the full name, including version, of the file. Make sure .js is appended to the end.  For example:

adrum-ext.f80a9c09501bf84dda829f25e54bc3a0.js

3. Point adrum.js to the local version of adrum-ext.js using the UI.

(info) If your users are likely to be using IE8 and WIndows XP, hosting adrum.js and adrum-ext.js locally will help insure that https beacons can be sent to the EUM Cloud correctly.

Using a Local Version of the Cross Domain Session Extension

If you are enabling cross domain session correlation and you are hosting the JavaScript extension locally, you need to host the cross domain session extension locally as well.

1. Download the JS agent as before.

2. Download the extension by clicking Download the Cross Domain Session Extension (adrum-xd.html). A new tab in your browser opens up and displays the single word, Ready.

3. Save the file in a location accessible to the web page as it is delivered to your user.  The file is an HTML file that contains a  script.  Use Use Save Page As in your browser to capture the full name, including version, of the file. Make sure .html is appended to the end.  For example:

adrum-xd.f80a9c09501bf84dda829f25e54bc3a0.html

4. Point adrum.js to the local version of adrum-ext.js and adrum-xd.html using the UI.

Placing the JavaScript Agent Somewhere Other than the Top of the Page

The preferred location for the JavaScript agent is at the top of the <head> section.  This is because one of the most important things that adrum.js does is capture the time as the page begins to load, and it is against that time that other timings are calculated, for all browsers.  However many - but not all - modern browsers support the Navigation Timing API (see here for a list), and for these browsers, timings can be acquired via the API. So locating the JS agent somewhere else on the page is possible, but useful timing information in that case is only available for those NavTime capable browsers.