Leveraging Adobe Analytics Tracking for Google Analytics via Google Tag Manager

The title is a mouthful but describes the situation. We, as analytics professionals, shouldn’t be limited to one vs another tracking capabilities and SHOULD be able to apply one to the other (if done correctly) to take advantage of the benefits it might provide.

This blog posting will show you how to do so.
Manual Steps:
Step 1 – Grab a copy of the s_code.js or appMeasurement library and place on your server. You could also try to host from google drive and include a reference from there to your site but I find it much easier to just have the JS file hosted on your server.
<script async src=’path/to/appMeasurement.js’></script>
Step 2 – Make sure that the script path is include just before your GTM container.  We want to make sure that GTM can take proper advantage of the logic that Adobe Analytics can provide.
<script async src=’path/to/appMeasurement.js’></script>
  dataLayer = [];
<!– Google Tag Manager –>
<noscript><iframe src=”//www.googletagmanager.com/ns.html?id=GTM-ABCDEF”
height=”0″ width=”0″ style=”display:none;visibility:hidden”></iframe></noscript>
new Date().getTime(),event:’gtm.js’});var f=d.getElementsByTagName(s)[0],
<!– End Google Tag Manager –>
Step 3 – Create a Custom HTML tag to push the Adobe Analytics logic to the datalayer so that GTM can take advantage of it. To do so, you will need to open GTM and create a Custom HTML tag that will house your dataLayer.push object. The trick here is to make sure that the code fires first before your Universal Analytics tag fires so that the logic will be accessible.  An example of the datalayer push is below:
  ‘daysSinceLastVisit’: s.prop1,
  ‘visitNumber’: s.prop2,
  ‘performanceTiming’: s.list1,
  ‘pageVisibility’: s.prop3,
  ‘adobePageName’: s.pageName,
  ‘timeParting’: s.prop4,
  ‘event’: ‘adobeAnalyticsTracking’
Step 4 – Create datalayer variables that map the logic placed in the Custom HTML to variables that can be used by Google Tag Manager within the necessary tags you want this to be in.
Step 5 – Add the variables created to the tags.  For the items in the example, these can be all added to your Universal Analytics Page View (Base) Tag so its captured on all page views.
Step 6 – Map the variables declared in the datalayer push to custom dimensions within the Google Analytics UI.
Step 7 – Test, test, test! Please be sure to properly test the logic in place before promoting to production
That’s it! With this in place, you can take advantage of the power that Adobe Analytics tracking provides and put that into Google Analytics for improved reporting and analysis.
Posted in Google Analytics, Google Tag Manager, Tag Management Solution, Web Analytics