Phil recently completed a 400 man-hours GTM project & shares lessons learned. Migrating from GA Classic to Universal on 6 CMS platforms and 600 GA classic events is one thing, but facing a fine if the project is not complete within 3 months ads a touch of spice! Phil cleaned-up 2 years of in-house changes, including changes such as consolidated 74 pageview tags and centralizing 20 tags into easy to mange lookup table.
Phil provides Technical insights for Advanced Implementers, aswell as Tactical insights for project managers & business people on area such as QA automation, mistakes to avoid, process examples & knowledge sharing tips.
Take-aways:
- QA tool
- Planning tools
- Free GTM developer guide
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Most Advanced GTM Deployment. Ever!
1. #emetrics @PHILPEARCE
New York
26th Oct 2016
Learnings from the most Advanced GTM
Deployment I have ever done!
(On a site with 1 billion hits a month)
By Phil Pearce
3. Agenda
1. Set the scene
– Size
– Complexity
– Timelines
2. How we got there
– Tools
– Strategy
3. Conclusion & take always
– Checklist / Solution Library
4. Questions
5. “How many Google Tag Manager
installations have YOU done?”
1. Newbie: 1-3 installation
2. Experienced: 4-10
installation
3. Advanced: 10+ installation
Survey results
https://plus.google.com/117298997433687198127/posts/dW5TjdS7XEV
https://twitter.com/philpearce/status/779678727861104640
Super Experienced
people
8. So, a beautiful but
HUGE new client just signed!
• 400 man-hours GTM project
• 600 GA classic events
• GA classic to Universal pageview migration
• Inhouse TMS.js migration to GTM
• 6 CMS platforms
• Only 3 months to complete!
• Fine per task, if not completed within the timeline!
11. Switch from GA classic
to GA universal
Migrate existing 200
GA events in GTM
Add 400 GA events
(auto-events)
Move pageview from
TMS.js (inhouse TMS)
into GTM
Preliminary GTM
account audit
Behemoth
Project Timeline
to climb the mountain
13. In Reality…
Inhouse IT dept slow to respond, thus
impossible to enforce the task based fines.
14. How did we get to the Summit?
And more importantly...
• What went right?
• What went wrong?
15. The Win was deliver by
Technical & Tactical working together!
BusinessTechnical
16. Plus lots of Tools & Techniques!
Technical (Phil)
• Testing Tools
• Strawman Test environment
• Separate DEV & LIVE environments
• Auto-QA
• Failsafe deadman switch
• Security
• Governance of Logins & access levels
• Controlling Risk factors
Tactical (Agency)
• Task prioritisation
• Split based on “required client
dependencies”
• Sorted based on cost vs benefit
• Weighted based on strategically
important items
Wins MistakesWins Mistakes
26. Auto-QA feedback loop… bit.ly/qatemplate
EventID
(GoogleSheet)
Added to each
GTM tag
GA api
(Googlesheet)
vLookup
(GoogleSheet)
Note: Ensure
CustomDimension[20]
enabled in GA settings
27. Auto-QA feedback loop… bit.ly/qatemplate
EventID
(GoogleSheet)
Added to each
GTM tag
GA api
(Googlesheet)
vLookup
(GoogleSheet)
29. GTM auto-event config file
bit.ly/gtmconfig (For any CMS)
Reminder: open the import files in notepad, then find & replace
“yourdomain” and “yourdomain.com” with YOURDOMAIN before import.
32. 2. Client-side switch example
<!– Client Side Switch: Google Tag Manager: Output myGTMID -->
<script>
var myHostname = window.location.hostname;
var myGTMID = 'GTM-xxx1'; // LIVE
if(myHostname === 'staging.behemothclient.com' || myHostname === 'localhost'){
myGTMID = 'GTM-xxx2'; // DEV
}
</script>
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-xxx1"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer', myGTMID);</script>
<!-- End Google Tag Manager -->
33. Note: This method can not be used on
JSvariables only Custom HTML tags.
3. Tag annotation & Failsafe block
34. Disable CustomHTML, but allow JS variables.
<script>
/* Working example: bit.ly/deadman-switch */
window.dataLayer = window.dataLayer || [];
dataLayer.push({"gtm.whitelist":
["google", "customPixels", "nonGooglePixels", "nonGoogleScripts", "jsm", "flc", "fls", "k"]
});
</script>
Disable CustomHTML and JS variables (breaks any JS lookup table wildcards)
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({"gtm.blacklist":
["customScripts"]
});
</script>
4. The Deadman switch example
Thankfully this was never used!
Note: alternative method for inline method to disable specific script was considered:
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({"hasPreventGTMscrollTrackingBeenSet": true});
var hasPreventGTMscrollTrackingBeenSet = true;
41. No client involvement: GA Settings:
1. Copy the 5 Goals from the TEST profile view to LIVE profile view
2. Create profile view for CART converted and CART non-converted
3. Create profile view for backend rolledup for Apps and Apps for userID
4. Improving organic by 1.5% by updating channel groupibehemoth
No client involvement: GTM config
1. Subscription e-commerce tracking via DOM scrapping
2. Enable Donate ecommerce revenue tracking
3. Consolidating 27 remarkting tags into 4 tags.
4. Reviewing & fix the remaining 178 triggers for errors.
5. Enable Adwords Dynamic remarking using lookup tables
6. Reducing self referrals from 1% to 0% by enabling legacyHistoryImport.
Split Client
dependencies
part1
49. Solution: Utilise newer feature such as
auto-events, lookup tables & tag templates
One BIG pile of spaghetti!
Inhouse GTM config built-up
over a 3 year period with 3+ users
52. Multiple users: Check-in/Check-out
Solution1: Check-in/Check-out processes
and enforce View | Edit access.
Email Role Account
Permissions
01.
LIVE
02
DEV
phil@agency.com Administrator manage users edit publish
dave@agency.com Tester view
brian@client.com Administrator manage users view view
mary@client.com Administrator manage users view view
mathew@client.com Tester view view
devtools@client.com Tester view
When Check-out set to read-only
53. Solution2: Create User sandboxes
User1 | User2 >> DEV >> LIVE
Multiple users: sandboxes
Email Role Job title Account
Permissions
01.
LIVE
02
DEV
Marys
Sandbox
Mathews
Sandbox
phil@agency.com Administrator Implementation Specialist manage users edit publish view view
dave@agency.com Tester Project Manager view
brian@client.com Administrator Systems Admin manage users view view view view
mary@client.com Administrator Analyst manage users view view publish view
mathew@client.com Publisher Marketing Manager view view publish
devtools@client.com Tester Robot Unit Tester view
GTM-xxx1 GTM-xxx2 GTM-zzzz GTM-xxxx
54. GTM user access audit
bit.ly/gtm-access-audit2
Also see David Vallejo`s free API based user-access tool here:
www.thyngster.com/gaupet-release-google-analytics-user-permissions-exploring-tool
55. Summary of safety features
1. 2 stage authentication
2. PII protection - via GA filter on URI & eventLabel
3. JS error tracking profile
4. Inline switch for GTM-DEV / GTM-LIVE
(can be client-side or serverside method)
5. Failsafe/deadman`s switch (dataLayer whitelist)
59. Moving TMS.js pageview into GTM was delayed
due to clients fragmented codebase
WPF 1st pageview script
images.behemothclient.com/wpf/CACHE/js/6f599508e0a4-cb1424263825.js
images.behemothclient.com/wpf/sites/common/j/analytics.js
www-s.behemothclient.com/wpf/sites/common/j/analytics.js
WPF 2nd pageview script on Members section
media-mmdb.behemothclient.com/static-media/js/analytics.js
WPF 3rd pageview script on Gallery buttons
images.behemothclient.com/wpf/sites/common/j/jquery.address-1.3.1-grant.min-cb1299116789.js
WPF 4th event script on Members section
assets.behemothclient.com/behemoth-header/build/lib/analytics.js
60. Deployed via GTM flag...
First method not effective as not a common field :(
_gaq.push(['_setCustomVar', 5, 'flag', '_gtmDeployed', 3]);
ga('secondaryTracker.set', 'dimension20', '_gtmDeployed');
Second method worked a charm!
var flag = document.title + '_gtmDeployed';
_gaq.push(['_title', flag ]);
ga("secondaryTracker.set", {title: flag});
Note: filter to clean-up the page title was required...
PP01a. EXCLUDE hits not deployed via GTM
Exclude filter for PageTitle (.*)_gtmDeployed$
PP01b. CLEAN PageTitle
PageTitle (.*)_gtmDeployed$
Output PageTitle $A1
PP02. INCLUDE pageview hits only
Include hitType=^pageview$
61. Set utmz cookie - so that inline gaq.push
events still work, but don’t effect hitlimit
Solution: _initData
var _gaq = _gaq || [];
_gaq.push(
['_setAccount', 'UA-1-1'],
['_addIgnoredRef', {{Page Hostname}} ],
['_addIgnoredRef', {{Page Hostname - www removed}} ],
['_setDomainName', {{jsm_setTopLevelDomain}} ],
['_setAllowLinker', true],
['_initData']
);
plus.google.com/117298997433687198127/posts/McER3buexek
68. Human Error on import & publish
which caused untested & broken version
to be accidentally deployed to LIVE!
Solution: User training & 2 people
used to verify go-live changes.
Wrong version
accidentally deployed
71. Project Learnings/Improvements
1. Remove "human factor"
(e.g. manual export from DEV to LIV)
2. Auto-QA change to use TagID and auto-detect if new GA event added
in GTM.
3. Enforce GTM audit at the beginning (not optional task)
4. Enforce a Project summary and feedback session at the end of every
phase (not optional task)
5. Move onto insight, dashboards, A/B testing or BigQuery sooner.
72. Unexpected wins
1. 1000 tags consolidate to 500 tags reduce gtm.js download size.
2. Reduction in JS errors after TMS.js change to GTM auto-events
3. Much easier to maintain pageview triggers.
4. SSL tag issues fixed
5. Cross-domain tracking was done without IT involvement using
JS variable script.
6. VideoProvider tracking was done without IT involvement using
DOM scrapping.
7. Ecommerce revenue enabled via DOM scraping.
74. Life saving tools
bit.ly/gtm-checklist
Technical (Phil)
1. +/-2% migration comparison sheet:
bit.ly/ga-api-example
2. Auto-QA sheet:
bit.ly/qatemplate
3. GTM auto-config file: bit.ly/gtmconfig
4. DEV strawman examples: bit.ly/strawman-test2
5. GTM developer guide: bit.ly/gtmdevguide2
• Script for "Deployed via GTM flag" to find
inline GA scripts (without using a crawler)
• Script for _initData to sustain gap.push events
Tactical (Agency)
1. Resource planning Gantt sheet:
bit.ly/ga-planning-chart2
2. Deadline planning sheet:
bit.ly/ga-timeline2
3. GTM user access audit:
bit.ly/gtm-access-audit2
4. GTM audit template:
bit.ly/gtm-audit-template
5. Free GTM Training videos:
bit.ly/gtmplaylist
75. Thankyou & Questions
Phil Pearce
Senior Web Analyst and GTM specialist
phildpearce@gmail.com
linkedin.com/in/philpearce
Web
Analytics
Exchange
mentor
750 GA
questions answered
Tracking
protection
group
Free Prize for the best question(s).