Tag Manager Improvements

Document created by DPM Admin Employee on Jul 14, 2017
Version 1Show Document
  • View in full screen mode

The short version:

With the latest version of boomerang (that is now the default) we have much better support for Google Tag Manager and other tag managers (such as Tealium, Ensighten, or Adobe Marketing Cloud).


We will have some issues with iOS, but those only come up if boomerang cannot be included in the <head> part of the page.


We are also working on further improvements to this which will resolve the iOS + not in the <head> issues and expect to start rolling them out in 2 weeks.


The long version (thanks Nic!):

Starting with boomerang.js version 0.9.1422498372, which is now the default version for all mPulse domains, Boomerang has better compatibility with tag managers, such as Google Tag Manager (GTM), Tealium, Ensighten, or Adobe Marketing Cloud.


A tag manager works by embedding a single JavaScript file in the page's HTML.  Instead of hard-coding additional scripts for all of the domain's analytics/ads/marketing/optimizing services, the single tag manager script loads these other scripts on-the-fly, according to the tag manager's rules.  These rules can be controlled via the tag manager's website, and can be changed outside of the normal development cycle.  This gives non-developers flexibility to add/change/remove scripts based on business needs and other rules without waiting for development resources.


Since Boomerang is a performance analytics tool, the default Boomerang loader snippet is suggested to be embedded directly in a <script> tag in the page's <head> HTML, instead of within a tag manager.  This used to be required because tag managers don't guarantee that the scripts they include will load prior to the page's "load" event.


However, the latest version of Boomerang now better supports being loaded after the page's "load" event, still capturing accurate page load times, with some caveats.  If Boomerang is loaded after the page's "load" event, it will look at the accurate performance metrics exposed by NaviationTiming supported browsers.  NavigationTiming is currently in available in 81% of world-wide market browser usage, according to CanIUse (http://caniuse.com/#feat=nav-timing).  Where it's notably lacking support is iOS Safari, which as of v8.1, does not include NavigationTiming.


In cases where NavigationTiming is not available, and boomerang.js was loaded after the page's "load" event, the "load time" of the page cannot be accurately determined, and Boomerang will assume the moment boomerang.js was downloaded is the "load time".


Whether or not this worst-case scenario happens when using a tag manager depends on a couple things:
1. Where the tag manager <script> is included on the host page
2. How quickly the tag manager <script> downloads its configuration and executes the configured tags/scripts
3. How many other resources are being downloaded on the page
4. How quickly boomerang.js can be downloaded from the CDN


Depending on the above, one of three scenarios will occur:
Scenario 1: In the best case scenario, all 4 items above occur prior to page load.  In this case, we will get accurate "page load" time.


Scenario 2: If boomerang.js loads after the page's "load" event, and the browser has NavigationTiming, we will get accurate "page load" time.


Scenario 3: In the worst-case scenario, boomerang.js loads after the page's "load" event and the browser does not have NavigationTiming.  In this case, the "page load" time will be "actual page load time" + "additional time it took to download boomerang.js after actual page load time".  In other words, the boomerang.js download stretches out the "page load" metric.


To ensure the best two scenarios, the tag manager script that includes the Boomerang loader snippet should be included in the <head> of the page.


Getting the Boomerang Version

To see the version of boomerang for an app, get its API key, and run this command on the command line (replace <API-KEY> with the actual API key):


curl -A 'Mozilla/5.0' http://c.go-mpulse.net/boomerang/<API-KEY> 2>/dev/null | grep 'BOOMR.version=' | sed -e 's/.*BOOMR.version=/BOOMR.version=/;s/;.*//'