Across a number of our clients, we heavily use Adobe Analytics within the agency. To better manage the analytics process and to avoid using the tech team to hard code the tracking onto each page, we use a Tag Manager to implement tracking.  This post will be exploring more about how to implement Adobe Analytics Page Load tracking with Google Tag Manager.

You may ask, if you already have a process for hardcoding page load tracking, why are you bothering to work through GTM for Adobe Tracking?
Well here are a few key reasons:

  1. We know exactly what tags are implemented and where they are implemented.
  2. There is no need to use a developer to implement the tracking and then having to test it is working.
  3. If there are any changes to pages or changes to tracking we can implement the changes ourselves, saving time and cutting out errors.
  4. Most importantly, this is a method of implementation that can save you time and money!

So now we know why we are doing this implementation, let’s see how we do it!

We already have the Adobe Analytics code hosted on the site we are looking to track, however if you do not here is how you would start:


Download the Adobe Analytics Code from the Code Manager.

Log on to Omniture and go to the admin section – where you will click on code manager (image 1).

Adobe Blog Image 1 - Where to find s_code.png

Image 1 – How to find code manager in adobe console. (source:


This will take you to a list of all the basic adobe codes, previously named s_code, now called AppMeasurement (image 2).

Adobe Blog Image 2 - Where to find s_code (2).png

Image 2- Base code folders within adobe code manager. (source:

If you download the newest version of the Javascript file you will get a zip file where the base code you need is the basic AppMeasurement.js. The top one below (image 3).
Adobe Blog Image 3 - Where to find s_code (3).png
Image 3 – AppMeasurement.js (source:

There are other versions of AppMeasurement for PHP but for now we will just stick the Javascript implementation.

Host the base adobe code, AppMeasurement, on your webserver.

This is fairly easy to do. Save the AppMeasurement file with a suitable name – we still use S_code.js or Omniture.js. Upload the saved file to your webserver. You will need to have the path of the file so that you can point to it when implementing using GTM. We can use an example path of the file being XXXXX/Omniture.js and so the total path of the AppMeasurement file will be

Once you have the s_code.js or appmeasurement.js file hosted on your webserver then you can create a Google Tag Manager container for your site.

This is where the only bit of hard-coding is required. The Google Tag Manager container code needs to be hard-coded onto very page of your site that you wish to track. Once that is done then the page load tracking can be done created within Goggle Tag Manager.


Create a Custom HTML Tag for Page Load Code

Once you have the s_code on the page then the last thing left to do is to create a custom HTML tag within your GTM container and create the trigger(s) needed to fire the tracking in the correct places.

The tracking you will be writing is Javascript so you need to open and close the custom HTML tag with <script> </script> tags to define the tag as Javascript.

After the opening <script> tag you will write all the variables that you want to fire on your page. I.e. all the props and eVars and any other custom variables or events that you require.

Finally, before the closing script tag you need to write:

Var s_code=s.t(); if(s_code)document.write(s_code)

This is the part of the tag which points to your base Omniture code and tells it to add all the variables that you have specified in the tag. The s.t function specifies to Adobe that it is a page load tag rather than which is on-click. You need to check the “Support document.write” box underneath the HTML tag so that your tag can write the code you have written into the hosted base code.


Below is an example of this custom HTML tag (opening <script> tag has been cut off the top).

Adobe Blog Image 4 - GTM pageload tag.png

You can create as many of these custom HTML page load tags as you require for different pages. We use a single tag with all the standard props and eVars that we have that fires on all pages and then create any extra tags with custom variables and triggers firing the tags on specific pages.

There it is! That is all there is to it to implement Adobe Analytics page load tracking using Google Tag Manager. Publish your tags and use any debugger to see the tracking firing.

If you would like to learn more about analytics don’t hesitate to contact the Analytics team at

Do you consider yourself a digital master? take our Digital IQ Test to prove it, From now until February 28th submit your Digital IQ Test score to be automatically entered into our draw for an iPad Mini.

Leave a Reply