GTM UnconditionalFiring

From Wiki

Jump to: navigation, search

Contents

[-] Google Tag Manager Unconditional firing

Google Tag Manager Unconditional firing

Defining triggers

Triggers need to be defined in Google Tag Manager to control the conditions in which you allow your 'Tags' to be displayed on the page via Google's container tag solution.

File:triggerIcon.png


Part 1: Define triggers

This will allow the Awin Conversion Tag to unconditionally fire on the confirmation/thankyou page

1) Click the “New” button

2) Select ‘Page View - DOM Ready’

3) Select 'Some DOM Ready Events'

4) Click ‘Page URL’ then ‘contains’ and enter the directory pathway for your confirmation page e.g checkout/success.

File:PageViewDOMReady.png

5) Click 'Save'

6) Rename this trigger e.g. ‘AwinConversionTagTrigger’

7) Click ‘save’ to have triggers in place.

File:TriggerView1.png

This will allow the Awin Mastertag to unconditionally fire on all pages except confirmation page

1) Click the “New” button

2) Select ‘Page View - DOM Ready’

3) Select 'Some DOM Ready Events'

4) Click ‘Page URL’ then ‘does not contain’ and enter the directory pathway for your confirmation page e.g checkout/success.

File:PageViewDOMReady2.png

5) Click 'Save'

6) Rename this trigger e.g. ‘AwinMastertagTrigger’

7) Click ‘save’ to have triggers in place.

File:TriggerView2.png

Part 2: Define the Awin Master tag tracking

Tags reference 3rd party tracking or code snippets you may want to place on site via the Google Tag Manager container.

File:tagIcon.png

1) Click “Tag”

2) Click “New” and choose the ‘Awin Journey’ tag (this is the masterTag that needs to be present on all pages incl. confirmation page).


4) Enter your advertiser ID provided by your Integrator

5) Select ‘AwinMastertagTrigger’ as the trigger

6) Name and save this tag appropriately

Part 3: Automatic de-duplication and the Channel Parameter

This allows Awin’s conversion tag to identify which was the last paid media to generate the last click in the user’s journey before the checkout, this way, Awin’s platform can determine which transactions came from Awin and which didn’t, this way having an automatic de-duplication performed. 1) Create a new variable and name it “Awin - ChannelCookie”, this should be a First Party cookie variable:

2) Name the cookie this way “AwinCookie”:

3) Create a new trigger and name it “Awin – Source Trigger”, this should be a DOM Ready type trigger: 4) Change this to fire on “Some DOM Ready events” and change the firing rules to “PageURL”, “Matches RegEx”, “((.*)utm_source=(.*))|((.*)gclid=(.*))”. (Without quotes):

5) Create a new tag and name it “Awin – Last Click Identifier”, this should be a Custom HTML type tag:

6) Add the following code to this tag:

<script type="text/javascript">
var date = new Date(); 
var latency;
var value;
var cookieLength = 30;
date.setTime(date.getTime()+(cookieLength *24*60*60*1000));
latency = date.toUTCString();
value = {{Page URL}}.search(/[?|&]gclid=/i)!=-1? "google" : {{Page URL}}.match(/[?|&]utm_source=([^&;$]*)|(gclid)/i)[1];
document.cookie = "AwinCookie=" + value + "; expires=" + latency + ";path=/; Domain=.INSERT_YOUR_DOMAIN_HERE.COM";
</script>

7) Edit the code above where it says “INSERT_YOUR_DOMAIN_HERE.COM”, to reflect your website’s domain, please keep the "." before your domain as it will take into consideration any subdomain from your website.

Part 4: Define the Awin sale tracking

1) Create a new Awin Tag and select the ‘Awin Conversion’ Tag.

2) Define your data layer values

3) Select the trigger defined in part 1 'AwinConversionTagTrigger'.

4) Click ‘Save’ and you will then be asked to rename the Tag but you can leave it as it is.

5) Click ‘save’ and you should now have two Tags listed in the Tags table.

Privacy

Due to new European legislation regarding how websites store information about you, AWIN is updating its privacy policy. You can see the new version of our policy here. If you would like to see the information we capture on this website, please click here for further details. In order to accept cookies on this site please click the 'I ACCEPT' button