Download PDF
Download page Upgrade the JavaScript Agent.
Upgrade the JavaScript Agent
This page covers how to upgrade the JavaScript Agent version. Upgrading to the latest version of the JavaScript Agent will allow you to use the latest features and get the latest bug fixes.
The following sections will discuss possible compatibility issues, show you a new way to include the JavaScript Agent, and provide you with manual injection code examples for the different JavaScript Agent hosting options.
Compatibility Issues
For on-premises deployments, your JavaScript Agent version should the same or older than your EUM Server version. For example, if you have deployed the EUM Server 20.3.0, the latest version of the JavaScript Agent you can use is 20.3.0. We recommend to upgrade your EUM Server to the latest version so you can take advantage of the latest JavaScript Agent features.
- If you are using an on-premises EUM Server and want to use a hosted version of
adrum.js
, you need to match theadrum.js
version to your EUM Server version. - For Controller versions, a JavaScript Agent version is compatible with Controller versions with the same or older versions. For example, JavaScript Agent 20.6.0 is compatible with Controller <= 20.6.0.
Injection Code Changes
If the URL to the server hosting your JavaScript Agent is the same for both HTTP and HTTPS, you should no longer use document.write
to inject the <script>
tag. Instead, just hardcode the <script>
tag with the following syntax:
<script src="//cdn.appdynamics.com/adrum/adrum.js"></script>
Injection Code for Different Hosting Options
The injection code will vary slightly depending on your deployment (SaaS/on-premises). The following provides you with code snippets for each type of deployment. Be sure to place the code snippets below right after the <head>
tag.
In the string below:
- Replace the string
<EUM_APP_KEY>
in the code below with your own EUM app key. - Replace
<
eum-col.appdynamics.com
>
in the code below with your corresponding collector URL.
<script charset='UTF-8'>
window['adrum-start-time'] = new Date().getTime();
(function(config){
config.appKey = '<EUM_APP_KEY>';
config.adrumExtUrlHttp = 'http://cdn.appdynamics.com';
config.adrumExtUrlHttps = 'https://cdn.appdynamics.com';
config.beaconUrlHttp = 'http://eum-col.appdynamics.com';
config.beaconUrlHttps = 'https://eum-col.appdynamics.com';
config.xd = {enable : false};
})(window['adrum-config'] || (window['adrum-config'] = {}));
<script src='//cdn.appdynamics.com/adrum/adrum-latest.js'></script>
In the code snippet below:
- Replace the string
<EUM_APP_KEY>
with your own EUM app key. - Replace the string
<your-cdn.com>
with the URL to your server hosting the JavaScript Agent. - Replace
<
eum-col.appdynamics.com
>
in the code below with your corresponding collector URL.
<script charset='UTF-8'>
window['adrum-start-time'] = new Date().getTime();
(function(config){
config.appKey = '<EUM_APP_KEY>';
config.adrumExtUrlHttp = 'http://<your-cdn.com>';
config.adrumExtUrlHttps = 'https://<your-cdn.com>';
config.beaconUrlHttp = 'http://eum-col.appdynamics.com';
config.beaconUrlHttps = 'http://eum-col.appdynamics.com';
config.xd = {enable : false};
})(window['adrum-config'] || (window['adrum-config'] = {}));
</script>
<script src='//<your-cdn.com>/adrum/adrum.js'></script>
In the code snippet below:
- Replace the string
<EUM_APP_KEY>
with your own EUM app key. - Replace the string
<your-cdn.com>
with the URL to where you're hosting the JavaScript Agent. - Replace
<
eum-col.appdynamics.com
>
in the code below with your corresponding collector URL.
<script charset='UTF-8'>
window['adrum-start-time'] = new Date().getTime();
(function(config){
config.appKey = '<EUM_APP_KEY>';
config.adrumExtUrlHttp = 'http://cdn.appdynamics.com';
config.adrumExtUrlHttps = 'https://cdn.appdynamics.com';
config.beaconUrlHttp = 'http://eum-col.appdynamics.com';
config.beaconUrlHttps = 'https://eum-col.appdynamics.com';
config.xd = {enable : false};
})(window['adrum-config'] || (window['adrum-config'] = {}));
</script>
<script src='//<your-cdn.com>/adrum/adrum.js'></script>