56

Click here to load reader

Implementing a Universal Analytics Strategy within Google Tag Manager

  • Upload
    bloovi

  • View
    1.407

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Implementing a Universal Analytics Strategy within Google Tag Manager

Let's go deeper with Google Tag Manager & Universal Analytics

Page 2: Implementing a Universal Analytics Strategy within Google Tag Manager

Let's go deeper with Google Tag Manager & Universal Analytics

Page 3: Implementing a Universal Analytics Strategy within Google Tag Manager

Let's go deeper with Google Tag Manager & Universal Analytics

Page 4: Implementing a Universal Analytics Strategy within Google Tag Manager

Let's go deeper with Google Tag Manager & Universal Analytics

Page 5: Implementing a Universal Analytics Strategy within Google Tag Manager

TABLE OF CONTENT

IntroductionEvent listenersCase: Click Event listeners (static - dynamic - combination with lookup tables)Case: Custom Event listeners: tracking scrolling on a one-page site (custom html tags)

Page 6: Implementing a Universal Analytics Strategy within Google Tag Manager

INTRODUCTION

GTM works with the combination of 3 elements:

Tags: JavaScript code

Triggers: condition that specifies when a tag should be fired

Variables: values used to define triggers or to dynamically insert info in a tag

How does it work?

Page 7: Implementing a Universal Analytics Strategy within Google Tag Manager

Tag: line of JavaScript that you add to the pages of your site.

INTRODUCTIONTags - Triggers - Variables

Which tags are supported by Google Tag Manager?

Page 8: Implementing a Universal Analytics Strategy within Google Tag Manager

Tag: line of JavaScript that you add to the pages of your site.

INTRODUCTIONTags - Triggers - Variables

Choose a tag type

Page 9: Implementing a Universal Analytics Strategy within Google Tag Manager

Tag: line of JavaScript that you add to the pages of your site.

INTRODUCTIONTags - Triggers - Variables

Configure the tag

Page 10: Implementing a Universal Analytics Strategy within Google Tag Manager

Tag: line of JavaScript that you add to the pages of your site.

INTRODUCTIONTags - Triggers - Variables

Which tags are supported by Google Tag Manager?

Page 11: Implementing a Universal Analytics Strategy within Google Tag Manager

Adwords conversion tag

INTRODUCTIONTags - Triggers - Variables

Page 12: Implementing a Universal Analytics Strategy within Google Tag Manager

Tag: line of JavaScript that you add to the pages of your site.

INTRODUCTIONTags - Triggers - Variables

Which tags are supported by Google Tag Manager?

Page 13: Implementing a Universal Analytics Strategy within Google Tag Manager

Custom Html Tags are mainly used to add JS/JQuery script on a webpage (without the interaction with the web agency).Sending non-Google partner conversion pixel

INTRODUCTIONTags - Triggers - Variables

Page 14: Implementing a Universal Analytics Strategy within Google Tag Manager

Give the possibility to play around dataLayer with conditions, loops, array, … and send information to Analytics or another tracking tool according to the user's behaviour.

INTRODUCTIONWhy to use Custom Html Tags

Page 15: Implementing a Universal Analytics Strategy within Google Tag Manager

Trigger: condition that specifies when a tag should be fired

INTRODUCTIONTags - Triggers - Variables

Page 16: Implementing a Universal Analytics Strategy within Google Tag Manager

Trigger: condition that specifies when a tag should be fired

INTRODUCTIONTags - Triggers - Variables

Page 17: Implementing a Universal Analytics Strategy within Google Tag Manager

INTRODUCTIONTags - Triggers - Variables

You can combine multiple conditions…

…and exclude others:

Page 18: Implementing a Universal Analytics Strategy within Google Tag Manager

Variable: values that define triggers, or dynamically set an information into a tag

Built-in variables:

INTRODUCTIONTags - Triggers - Variables

Page 19: Implementing a Universal Analytics Strategy within Google Tag Manager

Variable: values that can be tested by GTM to define triggers, or dynamically set an information into a tag

Built-in variables:

INTRODUCTIONTags - Triggers - Variables

Page 20: Implementing a Universal Analytics Strategy within Google Tag Manager

User-defined variables:

INTRODUCTIONWhat's a variable?

Page 21: Implementing a Universal Analytics Strategy within Google Tag Manager

User-defined variables:

INTRODUCTIONWhat's a variable?

Page 22: Implementing a Universal Analytics Strategy within Google Tag Manager

User-defined variables:

INTRODUCTIONWhat's a variable?

Page 23: Implementing a Universal Analytics Strategy within Google Tag Manager

Event listeners in Google Tag Manager

Page 24: Implementing a Universal Analytics Strategy within Google Tag Manager

EVENT LISTENERS IN GOOGLE TAG MANAGERWhat's new in the new UI

Listeners in GTM are fundamental to trigger tags mainly based on the user behaviour.

Event listeners are now integrated in the tag workflow.

Page 25: Implementing a Universal Analytics Strategy within Google Tag Manager

Click Event listener will fire a tag when someone clicks on an element of the page.

EVENT LISTENERS IN GOOGLE TAG MANAGERLet's go deeper into main event listeners: Click and Link Click Events

- All elements (click) : fires the tag when a click event is registered on page.- Just links (link click) : fires the tag only with a click on a link (<a href>), and bringing the user to another url.

Page 26: Implementing a Universal Analytics Strategy within Google Tag Manager

Wait for tags: ensure your tag will be fired before opening the link (in case of the tag takes too much time to be executed).

Check validation: ensure you click on a real <a href=""> link.

EVENT LISTENERS IN GOOGLE TAG MANAGERLet's go deeper into main event listeners: Click and Link Click Events

Page 27: Implementing a Universal Analytics Strategy within Google Tag Manager

Add filters to specify links.

EVENT LISTENERS IN GOOGLE TAG MANAGERLet's go deeper into main event listeners: Click and Link Click Events

Page 28: Implementing a Universal Analytics Strategy within Google Tag Manager

The Form Event listener will fire a tag when someone submits form data. It requires a submit() event to be triggered.<form>Name: <input type="text" name="name" />Email: <input type="text" name="email" /><input type="submit" /></form>

EVENT LISTENERS IN GOOGLE TAG MANAGERLet's go deeper into main event listeners: Form

Page 29: Implementing a Universal Analytics Strategy within Google Tag Manager

Check Validation will avoid to trigger a tag when required fields are not filled out.

EVENT LISTENERS IN GOOGLE TAG MANAGERLet's go deeper into main event listeners: Form

Page 30: Implementing a Universal Analytics Strategy within Google Tag Manager

We recommend not use the submit event listener with sophisticated technologies (Ajax, JS, JQuery, asynchronous

loading, …)

EVENT LISTENERS IN GOOGLE TAG MANAGERLet's go deeper into main event listeners: Form

Page 31: Implementing a Universal Analytics Strategy within Google Tag Manager

We suggest 2 workarounds:Trigger the tag when the user lands to the 'succeed' page after completing the form.

EVENT LISTENERS IN GOOGLE TAG MANAGERLet's go deeper into main event listeners: Form

Page 32: Implementing a Universal Analytics Strategy within Google Tag Manager

If the succeed page has no unique URL, ask you agency to push a dataLayer into the code of the page.<script>dataLayer.push({'event': 'form_succeed'});</script>

EVENT LISTENERS IN GOOGLE TAG MANAGERLet's go deeper into main event listeners: Form

Page 33: Implementing a Universal Analytics Strategy within Google Tag Manager

How to create static and

dynamic track events

Page 34: Implementing a Universal Analytics Strategy within Google Tag Manager

GTM IMPLEMENTATION STEP-BY-STEPSimple Google Analytics track event

Google Analytics track event based on a PDF download click:

Page 35: Implementing a Universal Analytics Strategy within Google Tag Manager

GTM IMPLEMENTATION STEP-BY-STEPSimple Google Analytics track event

Google Analytics track event based on a PDF download click:

Page 36: Implementing a Universal Analytics Strategy within Google Tag Manager

GTM IMPLEMENTATION STEP-BY-STEPSimple Google Analytics track event

Google Analytics track event based on a PDF download click:

Page 37: Implementing a Universal Analytics Strategy within Google Tag Manager

GTM IMPLEMENTATION STEP-BY-STEPSimple Google Analytics track event

Google Analytics track event based on a PDF download click:

Page 38: Implementing a Universal Analytics Strategy within Google Tag Manager

GTM IMPLEMENTATION STEP-BY-STEPSimple Google Analytics track event

Google Analytics track event based on a PDF download click:

Page 39: Implementing a Universal Analytics Strategy within Google Tag Manager

GTM IMPLEMENTATION STEP-BY-STEPSimple Google Analytics track event

Google Analytics track event based on a PDF download click:

Page 40: Implementing a Universal Analytics Strategy within Google Tag Manager

Event category: PDF

Event action: /VOO_evasion_UG_box_FR_150615.pdf

Event label: FR

GTM IMPLEMENTATION STEP-BY-STEPDynamic track event

Dynamically get the name of the pdf:

Page 41: Implementing a Universal Analytics Strategy within Google Tag Manager

Event category: PDF

Event action: /VOO_evasion_UG_box_FR_150615.pdf

Event label: FR

GTM IMPLEMENTATION STEP-BY-STEPDynamic track event

Dynamically get the name of the pdf:

Page 42: Implementing a Universal Analytics Strategy within Google Tag Manager

GTM IMPLEMENTATION STEP-BY-STEPDynamic track event

Dynamically get the name of the pdf:

Page 43: Implementing a Universal Analytics Strategy within Google Tag Manager

GTM Javascript

<script>url = "http://www.domain.be/nl/pdf/";langUrl = url.slice(21,23);switch (langUrl) { case "fr" : lang="French"; break; case "nl" : lang="Dutch"; break; case "en" : lang="English"; break;}alert(lang);</script>

Javascript

URL > /fr/pdf/document-a-telecharger/ Dynamic Event label > French / Dutch / English /…

GTM IMPLEMENTATION STEP-BY-STEPUse the power of Javascript

Work with Javascript to play around text element:

Page 44: Implementing a Universal Analytics Strategy within Google Tag Manager

GTM Javascript

<script>url = "http://www.domain.be/nl/pdf/";langUrl = url.slice(21,23);switch (langUrl) { case "fr" : lang="French"; break; case "nl" : lang="Dutch"; break; case "en" : lang="English"; break;}alert(lang);</script>

Javascript

GTM IMPLEMENTATION STEP-BY-STEPUse the power of Javascript

Work with Javascript to play around text element:

Page 45: Implementing a Universal Analytics Strategy within Google Tag Manager

GTM IMPLEMENTATION STEP-BY-STEPUse the power of Javascript

Work with Javascript to play around text element:

Page 46: Implementing a Universal Analytics Strategy within Google Tag Manager

Track scrolling on one-page site with Custom

Html Tags

Page 47: Implementing a Universal Analytics Strategy within Google Tag Manager

SECTION 1

SECTION 2

SECTION 3

SECTION 4

500 px

1400 px

1800 px

2250 px

650 px

Send VirtualTrackPageviews

…/section2/

SECTION 1

SECTION 2

SECTION 3

SECTION 4

500 px

1400 px

1800 px

2250 px

650 px

SECTION 1

SECTION 2

SECTION 3

SECTION 4

500 px

1400 px

1800 px

2250 px

TRACK SCROLLING ON ONE-PAGE SITE WITH CUSTOM HTML TAGSUse Custom Html Tags to trigger tags on read web page section

Page 48: Implementing a Universal Analytics Strategy within Google Tag Manager

SECTION 1

SECTION 2

SECTION 3

SECTION 4

500 px

1400 px

1800 px

2250 px

650 px

Send VirtualTrackPageviews

…/section2/

TRACK SCROLLING ON ONE-PAGE SITE WITH CUSTOM HTML TAGSUse Custom Html Tags to trigger tags on read web page section

Page 49: Implementing a Universal Analytics Strategy within Google Tag Manager

If position scroll (650px) > top section2 (500px) and < bottom section2 (1400px)then send '/product/section2/' to Google Analytics

<script>jQuery(function($) {topContent = false;posScroll = $(window).scrollTop()+$(window).height();posScroll2 = $(window).scrollTop();topSection1 = $('div.section1').position().top+$('div.section1').height(); topSection1bis = $('div.section1').position().top;if (((posScroll >= topSection1 && posScroll < topSection1+150) || (posScroll2 >= topSection1bis-150 && posScroll2 < topSection1bis-50)) && !topContent) { dataLayer.push({'event':'ScrollBarEvent', 'virtualUri':'/product/section1/'});

topContent = true; }}</script>

If position scroll (650px) > top section2 (500px) and < bottom section2 (1400px)then send '/product/section2/' to Google Analytics

TRACK SCROLLING ON ONE-PAGE SITE WITH CUSTOM HTML TAGSUse Custom Html Tags to trigger tags on read web page section

If position scroll (650px) > top section2 (500px) and < bottom section2 (1400px)then send '/product/section2/' to Google Analytics

Page 50: Implementing a Universal Analytics Strategy within Google Tag Manager

If position scroll (650px) > top section2 (500px) and < bottom section2 (1400px)then send '/product/section2/' to Google Analytics

<script>jQuery(function($) {topContent = false;posScroll = $(window).scrollTop()+$(window).height();posScroll2 = $(window).scrollTop();topSection1 = $('div.section1').position().top+$('div.section1').height(); topSection1bis = $('div.section1').position().top;if (((posScroll >= topSection1 && posScroll < topSection1+150) || (posScroll2 >= topSection1bis-150 && posScroll2 < topSection1bis-50)) && !topContent) { dataLayer.push({'event':'ScrollBarEvent', 'virtualUri':'/product/section1/'});

topContent = true; }}</script>

TRACK SCROLLING ON ONE-PAGE SITE WITH CUSTOM HTML TAGSUse Custom Html Tags to trigger tags on read web page section

If position scroll (650px) > top section2 (500px) and < bottom section2 (1400px)then send '/product/section2/' to Google Analytics

Page 51: Implementing a Universal Analytics Strategy within Google Tag Manager

TRACK SCROLLING ON ONE-PAGE SITE WITH CUSTOM HTML TAGSUse Custom Html Tags to trigger tags on read web page section

Page 52: Implementing a Universal Analytics Strategy within Google Tag Manager

TRACK SCROLLING ON ONE-PAGE SITE WITH CUSTOM HTML TAGSUse Custom Html Tags to trigger tags on read web page section

Page 53: Implementing a Universal Analytics Strategy within Google Tag Manager

TRACK SCROLLING ON ONE-PAGE SITE WITH CUSTOM HTML TAGSUse Custom Html Tags to trigger tags on read web page section

dataLayer.push({'event':'ScrollBarEvent', 'virtualUri':'/product/section1/'});

Page 54: Implementing a Universal Analytics Strategy within Google Tag Manager

TRACK SCROLLING ON ONE-PAGE SITE WITH CUSTOM HTML TAGSUse Custom Html Tags to trigger tags on read web page section

Google Analytics results

Page 55: Implementing a Universal Analytics Strategy within Google Tag Manager

THANK YOU

Page 56: Implementing a Universal Analytics Strategy within Google Tag Manager

THANK YOU