Tracking Code

The tracking code is a code snippet you can add to all pages or specific pages on your properties to track user behaviors.

You can add the tracking code to pages using one of the following methods:

Viewing the tracking code

On the navigation bar, go to Settings button settings > Property Settings > Tracking code.

The tracking code is displayed in the large text box.Tracking code settings screenThe following information is displayed above the tracking code on both DXA-hosted and self-hosted properties:Information displayed for tracking codes on both DXA-hosted and self-hosted properties.
InformationDescription
AccountYour DXA account ID
Property IDThe selected property ID
Note: If you have more than one property on your account, use the dropdown menu on the navigation bar to view the tracking code for another property.
DomainsDomains associated with the selected property
The following information is only displayed on self-hosted properties:Information displayed for tracking codes on self-hosted properties.
InformationDescription
Script versionMost recent tracking code released
Deployed script versionTracking code currently deployed on the account
Note: If an old tracking code is currently deployed on the account, this information appear in red, as displayed in the image above.
Configuration versionMost recent custom JavaScript included in the tracking code
Deployed configuration versionCustom JavaScript version currently deployed on the account
Note: If you edit custom JavaScript in the DXA portal, you must redeploy the tracking code for changes to take effect.
To download a JavaScript file containing the most recent tracking code for self-hosted properties, click Download script.
Note: Download script is not available on DXA-hosted properties.

Pasting the tracking code in the page source code

  1. In the tracking code text box, click Copy code.

  2. Paste the tracking code snippet in the source code of every page you want to track.