Tags and data layer

Managing tagging for analytics and other tools

All tagging on Aviva web pages is managed through a tag manager with data provided to it through a data layer.


Tag management

Aviva use the Adobe Dynamic Tag Manager (DTM). The following HTML must be included on every web page:

For production environments as the last line of the head:

<head>
    ...
    <script src="https://www.aviva.co.uk/metrics/fb6bbc707c73b3bbf55de42292764ed12602d62f/satelliteLib-97e2e6b61c5ebef9332bff19c8a6ed5a058df5f2.js"></script>
</head>

Or for all lower environments (the only difference is the apending of '-staging' to the file name):

<head>
    ...
    <script src="https://www.aviva.co.uk/metrics/fb6bbc707c73b3bbf55de42292764ed12602d62f/satelliteLib-97e2e6b61c5ebef9332bff19c8a6ed5a058df5f2-staging.js"></script>
</head>

And on all pages in all environments as the final line before the closing body tag:

<body>
    ...
    <script>_satellite.pageBottom();</script>
</body>

Data layer

The data layer is a JavaScript object, which we have called 'digitalData', containing multiple nested variables in a hierarchical structure. The data layer is dynamic and the number of variables will change depending on the page being viewed. It is designed to capture key information about the page/customer which the analytics and marketing teams can harness. With the benefit of reducing the need for developers time working on hard coded tagging.

<script>
    var digitalData = {
        'page': {
            'language': 'en-GB',
            'country': 'uk'
        }
    }
</script>

Centrally managed code

The core JavaScript for any tools implemented via the tag manager must be stored centrally and managed through version control. This includes the following tools:

  • Adobe Anaytics (s_code.js)
  • Adobe Target (mbox.js and at.js)
  • Adobe Audience Manager
  • IBM Tealeaf

s_code.js

The main javascript code to record the tracking data into Adobe Analytics is contained in s_code.js, within this file are –

  • The main global configuration settings for the Aviva version of Adobe Analytics
  • Plugins and modules to provide extra tracking data not supplied by the core product (such as video tracking)
  • The core code provided by Adobe

The main configuration settings can be updated and changed as required by the Aviva Digital IT team in consultation with Adobe. However the core code along with that for modules and plugins is maintained by Adobe and supplied to Aviva as necessary.

Testing

Here are some useful methods to use to ensure your tagging works as you intended.

Adobe DTM Debugger

The following code is a bookmarklet that will launch the Adobe DTM Debugger. To use it create a bookmark in your browser and paste the code into the location or url of the bookmark.

javascript:void(window.open("","disruptive_dtm_debugger","width="+screen.width+",height="+screen.height+",location=0,menubar=0,status=1,toolbar=0,resizable=1,scrollbars=1").document.write("<script%20id=\"disruptive_dtm_debugger\"%20src=\"//assets.adobedtm.com/d00638433326249dc42ea6fc89a4f65bfba18066/scripts/satellite-55fae9a2666337593b0005c2.js\"></"+"script>"));