Implement Adobe Analytics with AppMeasurement for JavaScript
- Topics:
- Implementation Basics
CREATED FOR:
- Developer
AppMeasurement for JavaScript has historically been a common method to implement Adobe Analytics. However, with increasing popularity of Tag Management Systems, using tags in Adobe Experience Platform is recommended.
A high-level overview of the implementation tasks:
Add AppMeasurement.js
to your website's template file. The code contains the libraries required to send data to Adobe.
<head>
<script src="AppMeasurement.js"></script>
…
</head>
Define configuration variables within AppMeasurement.js
. When the Analytics object is instantiated, these variables make sure that data collection settings are correct.
// Instantiate the Analytics tracking object with report suite ID
var s_account = "examplersid";
var s=s_gi(s_account);
// Make sure data is sent to the correct tracking server
s.trackingServer = "example.data.adobedc.net";
Define page-level variables within your site's page code. These variables determine specific dimension and metrics sent to Adobe.
s.pageName = "Example page";
s.eVar1 = "Example eVar";
s.events = "event1";
Send the data to Adobe using the t()
method, when all page variables are defined.
s.t();