Page 1
Reaktor Mannerheimintie 2 00100, Helsinki Finland
tel : +358 9 4152 0200 www.reaktor.com [email protected]
Confidential ©2015 Reaktor All r ights reser ved
Tweaks and tricks For Google Tag Manager and Google Analytics
@SimoAhava | #GAUC15 | 17 June 2015
Page 2
Simo AhavaSenior Data Advocate, Reaktor
@SimoAhava | #GAUC15 | 17 June 2015
Google Developer Expert, Google Analytics
Blogger, developer, www.simoahava.com
Twitter-er, @SimoAhava
Google+:er, +SimoAhava
Page 3
Plug-and-play AnalyticsStop. Stop doing it. Stop it now.
@SimoAhava | #GAUC15 | 17 June 2015
Page 4
Google Analytics is a tool designed to work for
9,352,458* different businesses.
* Author’s estimate, not an official figure
@SimoAhava | #GAUC15 | 17 June 2015
Page 5
It is thus conceivable Google doesn’t know what your business
objectives are.@SimoAhava | #GAUC15 | 17 June 2015
Page 6
23.75 %@SimoAhava | #GAUC15 | 17 June 2015
Page 7
23.75 %Dear CMO, last month, the Ecommerce Conversion Rate on our site
was…
…which is an uplift of 3.45% compared to the previous month!
@SimoAhava | #GAUC15 | 17 June 2015
Page 8
2,342,566Dear CMO, last month, the number of sessions to our site was…
…which is an uplift of 3.45% compared to the previous month!
Digital Analytics Café 20-May-2015 | @SimoAhava
Page 9
Definition of a Session• Group of interactions that takes place on a website…
• That expires after 30 minutes of inactivity…
• Or at the end of they day…
• Or when acquisition campaign changes…
• Unless the referral is in the Referral Exclusion List…
• Or traffic is cross-domain, and cross-domain tracking is implemented…
• Unless it’s implemented incorrectly…
• Which is likely since it’s so !#/%(“% difficult…
• Unless you’re using Google Tag Manager…
• Except if you’ve implemented THAT incorrectly…
@SimoAhava | #GAUC15 | 17 June 2015
Page 10
All metrics and dimensions used by a platform subscribe to the schemas of said platform!
GPeC Summit 11-May-2015 | @SimoAhava
Page 11
All metrics and dimensions used by a platform subscribe to the schemas of said platform!
GPeC Summit 11-May-2015 | @SimoAhava
Sessionization Schema
Page 12
This has two major implications on how we collect, process, and
analyse the data.
@SimoAhava | #GAUC15 | 17 June 2015
Page 13
Stay away from aggregate metrics.1
@SimoAhava | #GAUC15 | 17 June 2015
Page 14
Stay away from aggregate metrics.Combine, segment,visualize, predict.1
@SimoAhava | #GAUC15 | 17 June 2015
Page 15
Plug-and-play metrics are crap. Data must be collected and reported in a meaningful way.2
@SimoAhava | #GAUC15 | 17 June 2015
Page 16
Tweaks & TricksTo improve data quality at data collection time.
@SimoAhava | #GAUC15 | 17 June 2015
Page 17
Trick 1: Add true hit timestamp
Page 18
@SimoAhava | #GAUC15 | 17 June 2015
Create a Custom Dimension
GA
Page 19
@SimoAhava | #GAUC15 | 17 June 2015
Custom JavaScript Variable to calculate ISO time
GTM
Page 20
@SimoAhava | #GAUC15 | 17 June 2015
Add the Custom JavaScript Variable to your tags
GTM
Page 21
@SimoAhava | #GAUC15 | 17 June 2015
http://goo.gl/fA8d0f
Page 22
Trick 2: Add client Id as a dimension
Page 23
@SimoAhava | #GAUC15 | 17 June 2015
Create a Custom Dimension
GA
Page 24
@SimoAhava | #GAUC15 | 17 June 2015
Setup the GA tracker in a Custom HTML Tag
GTM
Page 25
@SimoAhava | #GAUC15 | 17 June 2015
Add the client ID to the Tag, and fire with the Custom Event
GTM
Page 26
@SimoAhava | #GAUC15 | 17 June 2015
http://goo.gl/dkkgZr
Page 27
Trick 3: Add session Id as a dimension
Page 28
@SimoAhava | #GAUC15 | 17 June 2015
Create a Custom Dimension
GA
Page 29
@SimoAhava | #GAUC15 | 17 June 2015
Custom JS Variable to return random ID
GTM
Page 30
@SimoAhava | #GAUC15 | 17 June 2015
Add the Custom JS Variable as a Custom Dimension
GTM
Page 31
@SimoAhava | #GAUC15 | 17 June 2015
http://goo.gl/fA8d0f
Page 32
Trick 4: Track dwell and scroll
Page 33
@SimoAhava | #GAUC15 | 17 June 2015
Custom HTML Tag fires on DOM Ready
GTM
Page 34
@SimoAhava | #GAUC15 | 17 June 2015
Event Tag fires when dwell & scroll recorded
GTM
Page 35
@SimoAhava | #GAUC15 | 17 June 2015
http://goo.gl/AYXiki
Page 36
Trick 5: Track scroll depth
Page 37
@SimoAhava | #GAUC15 | 17 June 2015
Custom HTML Tag to setup the listener
GTM
Page 38
@SimoAhava | #GAUC15 | 17 June 2015
Bunch of Data Layer Variables to capture the data
GTM
Page 39
@SimoAhava | #GAUC15 | 17 June 2015
Event Tag to send the data to GA
GTM
Page 40
@SimoAhava | #GAUC15 | 17 June 2015
https://github.com/sahava/content
Page 41
Trick 6: Track content with Ecommerce
Page 42
@SimoAhava | #GAUC15 | 17 June 2015
Setup Enhanced Ecommerce in the GA View
GA
Page 43
@SimoAhava | #GAUC15 | 17 June 2015
Figure out the terminology
GTM
Page 44
@SimoAhava | #GAUC15 | 17 June 2015
Connect interactions with the data layer
GTM
Page 45
@SimoAhava | #GAUC15 | 17 June 2015
Create Tags for the individual events
GTM
Page 46
@SimoAhava | #GAUC15 | 17 June 2015
Enjoy the awesomeness
GA
Page 47
@SimoAhava | #GAUC15 | 17 June 2015
GA
http://goo.gl/pkQmqU
Page 48
Trick 7: Block Internal Traffic
Page 49
@SimoAhava | #GAUC15 | 17 June 2015
Create a Custom Dimension
GA
Page 50
@SimoAhava | #GAUC15 | 17 June 2015
Create the View Filter
GA
Page 51
@SimoAhava | #GAUC15 | 17 June 2015
Create a URL Query Variable
GTM
Page 52
@SimoAhava | #GAUC15 | 17 June 2015
Add the Custom Dimension to a Tag
GTM
Page 53
@SimoAhava | #GAUC15 | 17 June 2015
WEB
http://goo.gl/gTauIV
Page 54
Trick 8: Create custom event handlers
Page 55
@SimoAhava | #GAUC15 | 17 June 2015
Custom HTML Tag to setup the listener
GTM
Page 56
@SimoAhava | #GAUC15 | 17 June 2015
Custom JS Variable to work as a generic handler
GTM
Page 57
@SimoAhava | #GAUC15 | 17 June 2015
GTM
http://goo.gl/IViqTG
Page 58
Trick 9: Track weather as a dimension
Page 59
@SimoAhava | #GAUC15 | 17 June 2015
How it works
Page 60
@SimoAhava | #GAUC15 | 17 June 2015
Create Custom Dimensions
GA
Page 61
@SimoAhava | #GAUC15 | 17 June 2015
Custom HTML Tag to collect the data
GTM
Page 62
@SimoAhava | #GAUC15 | 17 June 2015
Event Tag to send weather data to GA
GTM
Page 63
@SimoAhava | #GAUC15 | 17 June 2015
http://goo.gl/3todBm
Page 64
Trick 10: Track page visibility
Page 65
@SimoAhava | #GAUC15 | 17 June 2015
Page 66
@SimoAhava | #GAUC15 | 17 June 2015
Page 67
@SimoAhava | #GAUC15 | 17 June 2015
Page 68
@SimoAhava | #GAUC15 | 17 June 2015
Page 69
@SimoAhava | #GAUC15 | 17 June 2015
Page 70
@SimoAhava | #GAUC15 | 17 June 2015
Page 71
@SimoAhava | #GAUC15 | 17 June 2015
Page 72
@SimoAhava | #GAUC15 | 17 June 2015
Page 73
@SimoAhava | #GAUC15 | 17 June 2015
http://goo.gl/RgA1Zh
Page 74
@SimoAhava | #GAUC15 | 17 June 2015
http://goo.gl/80o1ml
Page 75
BONUS: Inject semantic data for crawlers
Page 76
@SimoAhava | #GAUC15 | 17 June 2015
Custom HTML Tag to inject Meta Descriptions with
GTM
http://goo.gl/1gB762
Page 77
@SimoAhava | #GAUC15 | 17 June 2015
Custom HTML Tag to inject Structured Data with
GTM
http://goo.gl/YAXonr
Page 78
Data is difficultIt’s supposed to be. Stop complaining.
@SimoAhava | #GAUC15 | 17 June 2015
Page 79
@SimoAhava | #GAUC15 | 17 June 2015
Rule of Data Passivity
Data does nothing. Data beats nothing. Data is a passive medium that requires
an active agent (analyst) to interpret.
Page 80
Rule of Data Subjectivity
Interpretation of data requires a well-formulated hypothesis. The same data set can be good for one hypothesis and
bad for another.
@SimoAhava | #GAUC15 | 17 June 2015
Page 81
@SimoAhava | #GAUC15 | 17 June 2015
Rule of Data Scarcity
You will never have all the data. An arbitrary line must be drawn in data collection, and you must be aware of
this limitation at all times.
Page 82
Data quality is directly proportional to how well you understand the data
collection mechanism.
@SimoAhava | #GAUC15 | 17 June 2015
Page 83
2,342,566Dear CMO, last month, the number of sessions to our site was…
…which is an uplift of 3.45% compared to the previous month!
Digital Analytics Café 20-May-2015 | @SimoAhava
Page 84
Thank [email protected]
www.simoahava.com
Twitter: @SimoAhava
Google+: +SimoAhava
@SimoAhava | #GAUC15 | 17 June 2015