GTM Dedupe EN

From Wiki

Jump to: navigation, search

Português

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, thus 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 “AwinChannelCookie”:

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 - Create Cookie Channel”, this should be a Custom HTML type tag:

6) Add the following code to this tag:

<script>
    var Data = new Date();
    var latency;
    //cookiePeriod should reflect what is in the contract, default is 30 days.
    var cookiePeriod = 30;
    var source;
    var sourceParameter = "utm_source";
    var queryString = window.location.search;
    var urlParams = new URLSearchParams(queryString);
 
    Data.setTime(Data.getTime() + (cookiePeriod * 24 * 60 * 60 * 1000));
    latency = Data.toUTCString();
 
    //Check if last click was Awin, and if not other paid medias that use "utm_source" or other parameters such as google ads
    if (urlParams.get(sourceParameter) != "awin" && urlParams.get(sourceParameter) != null || window.location.href.indexOf("gclid") > -1) {
        source = "other";
    } else {
        source = "aw";
    }
 
    document.cookie = "AwinChannelCookie=" + source + "; expires=" + latency + ";path=/; Domain=.INSERT_YOUR_DOMAIN.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.

8) Use the "Awin - Source Trigger as the trigger for this tag":

9) Add the "Awin - ChannelCookie" variable to your Awin Conversion Tag:

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