SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
Morphing GA into
an Affiliate Analytics Monster
By Phil Pearce
#MeasureCamp @PHILPEARCE
London
25th March 2017
Warning / Disclaimer
1. GA is design for audience measurement
(not affiliates tracking)
2. Run this on a parallel GA account (not your
main GA account) as it will report very
different numbers and use _ga2 cookie.
3. This is not a simple process…
Pls Download and import this GTM file:
bit.ly/affiliatemonsterdownload
Or use this generic login:
username: coolgtmstuff@gmail.com
password: philrulesgtm7
Select "Affiliate Monster container"
Working Demo
…but, I like to push the
boundaries of what`s possible
(with GA)…
…and I`m a slightly
Mad Analytics Scientist!
Note: It has taken lots of
<body>s to get to this point…
GTM <body>`s from the past...
But it worked!
and… the data came alive :)
Before vs After
Agenda
Agenda
1. Define the problem
– Business Alignment (custom business logic in affiliate industry)
– 1st party vs 3rd party cookies
– GA is whitelisted on Adblocker plus
– Existing affiliateId=123 params ignored by GA (and utm_id not used by affiliates)
2. Solution
– Mapping affiliateId to utm_id
– Overwriting setLocation & setReferral
– DimensionWidening via CSV upload of affiliateId >> source/medium/campaign
3. Learnings/Mistakes
– Enabling utm campaign cookie to prevent session reset on 2nd page
– Accounting for #utm vs ?utm
4. Future improvements
– Organic and Social organic cookie
– Cross-domain tracking of source and affiliateId (#_ga=xxx.xxx pigybacking)
– GoogleSheet for affiliateId DimensionWidening
5. Questions
This is the story of one such
mad Analytics Experiment…
So, new super-affiliate
client just signed!
• GA classic >> GA universal migration via GTM
• 5 CMS environments
(Desktop, New Mobile, Old mobile site, Tablet, Campaign Site)
• utm tags only used on email and banners
• Affiliates 90% of traffic but missing utm tags. Hence, Direct was 80% of traffic!
• Marketing Channel Analysis not possible in GA!!
Source: builtwith.com/detailed/behemothclient.com
5 CMS platforms:
Desktop, New Mobile, Old mobile site,
Tablet and Campaign Site.
Cleaning & Standardise
Equipment before the
big operation
Testing on Mice
1. Parallel Tracker
2. Unit Tests & Sinario Tests
3. Query Time utm_id widening
Alive indefinitely
Unit Test / Mice Test
Code Refinements
1 day Live test
Standardise GTM
SetupAffiliate
Monster
Project Timeline
3 months bring the beast to life
In Reality…
It was really hard!
Insert Picture of
- Phil with no hair
and
- lots of dead mice
But we did get there :)
But about those dead mice…
Why not use native GA?
1. setSource utm field (rather than setLocation)
2. Custom Multi-channel funnels
3. BigQuery sessionisation [GA Prem. feature]
4. GA 6 mth sessions setting changed to 30days
5. utm_nooveride=1 not used
Recipe for a Affiliate Monster
1. Have GTM on all pages
2. Declare affiliateTracker name
3. Declare ga2 object
4. Declare ga2 cookie
5. setLocation override in pageview
6. setReferral override in pageview
7. Be on SSL (or enable meta always send referral)
Mistakes to Avoid
1. cleaning/removing existing utm params
2. Accounting for the order of params
3. #utm vs ?utm or both
4. removing double-quotes
5. JS logic: gclid/dclid >> utm >> affiliateId >>
organic >> social referral >> referral
Pls Download and import this GTM file:
bit.ly/affiliatemonsterdownload
Or use this generic login:
username: coolgtmstuff@gmail.com
password: philrulesgtm7
Select "Affiliate Monster container"
Working Demo
part1: jsv_pageHostnameTLD
function(){
var domain={{Page Hostname - www removed}};
var rootDomain = undefined;
if (domain) {
domain.toLowerCase();
}
if (domain.substring(0,4)=="www.") {
domain=domain.substring(4,domain.length);
}
var domParts = domain.split('.');
for(var i=1;i<=domParts.length;i++)
{
document.cookie="gtmtestcookie1=1; path=/; domain="+domParts.slice(i*-1).join('.');
if(document.cookie.indexOf("gtmtestcookie1") != -1){
var rootDomain = domParts.slice(i*-1).join('.');
document.cookie="gtmtestcookie1=1; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/; domain="+domParts.slice(i*-1).join('.');
break;
}
}
return rootDomain;
}
part2:
setCookie for utm_id setTrackingSessionCookie
<script>
function setTrackingSessionCookie(trackingCookieName, cookieValue, cookieDaysDuration) {
var pageHostnameTLD = {{jsv_pageHostnameTLD}};
var cookieExpires = "";
if (cookieDaysDuration) {
var date = new Date();
date.setTime(date.getTime() + (cookieDaysDuration *24*60*60*1000) );
cookieExpires = "; expires=" + date.toGMTString(); // If not provided, it will be a session cookie.
}
// Session SetCookie
if (trackingCookieName && cookieValue) {
document.cookie = trackingCookieName + '=' + cookieValue + cookieExpires + '; domain=' + pageHostnameTLD + '; path=/';
}
};
// Set Based on URL or URL Hash
setTrackingSessionCookie("gclid", {{Page URL Query tracking gclid}} , "30");
setTrackingSessionCookie("dclid", {{Page URL Query tracking dclid}} , "30");
setTrackingSessionCookie("utm_id", {{Page URL Query tracking utm_id}} , "30");
setTrackingSessionCookie("utm_source", {{Page URL Query tracking utm_source}} , "30");
setTrackingSessionCookie("utm_medium", {{Page URL Query tracking utm_medium}} , "30");
setTrackingSessionCookie("utm_campaign", {{Page URL Query tracking utm_campaign}} , "30");
setTrackingSessionCookie("utm_content", {{Page URL Query tracking utm_content}} , "30");
setTrackingSessionCookie("utm_keyword", {{Page URL Query tracking utm_keyword}} , "30");
setTrackingSessionCookie("utm_userid", {{Page URL Query tracking utm_userid}} , "30");
</script>
part3: setLocation
<script>
function setTrackingLocation() {
var pageProtocol = {{Page URL Protocol}};
var pageHostname = {{Page Hostname}};
var pagePath = {{Page Path}};
var pageQuery = {{Page URL Query}};
var referrerHostname = {{Referrer Hostname - www removed}};
var countryCode = {{Lookup CountryCode from Country1 - PP reminder to check DE SH or DESH or SH}};
var deviceType = {{Lookup bespokeDeviceCategory from ContainerID}};
var cookieGoogleClickid = {{cookie gclid}};
var cookieDoubleClickId = {{cookie dclid}};
var cookieUtmId = {{cookie utm_id}};
var cookieUtmSource = {{cookie utm_source}};
var cookieUtmMedium = {{cookie utm_medium}};
var cookieUtmCampaign = {{cookie utm_campaign}};
var cookieUtmContent = {{cookie utm_content}};
var cookieUtmKeyword = {{cookie utm_keyword}};
var cookieAffiliateId = {{cookie affiliateId}};
var cookieIsLandingPageHit = {{cookie session gtm_isLandingPageHit}};
cookieIsLandingPageHit = ( cookieIsLandingPageHit == undefined ) ? "true" : "false";
// 0. Remove double-quote within utm tags... ""textlink"/adcash" to "textlink/adcash"
// 0. Change undefined to empty string so no risk of "utm_source=undefined"
pageQuery = (typeof pageQuery !== 'undefined') ? pageQuery.replace(/["]+/g, '') : "";
cookieAffiliateId = (typeof cookieAffiliateId !== 'undefined') ? cookieAffiliateId.replace(/["]+/g, '') : "";
cookieUtmId = (typeof cookieUtmId !== 'undefined') ? cookieUtmId.replace(/["]+/g, '') : "";
cookieUtmSource = (typeof cookieUtmSource !== 'undefined') ? cookieUtmSource.replace(/["]+/g, '') : "";
cookieUtmMedium = (typeof cookieUtmMedium !== 'undefined') ? cookieUtmMedium.replace(/["]+/g, '') : "";
cookieUtmCampaign = (typeof cookieUtmCampaign !== 'undefined') ? cookieUtmCampaign.replace(/["]+/g, '') : "";
cookieUtmContent = (typeof cookieUtmContent !== 'undefined') ? cookieUtmContent.replace(/["]+/g, '') : "";
cookieUtmKeyword = (typeof cookieUtmKeyword !== 'undefined') ? cookieUtmKeyword.replace(/["]+/g, '') : "";
Part4: isLandingPage cookie check
part5: isLandingPageHit
function() {
return function() {
setTrackingSessionCookie("gtm_isLandingPageHit", "false");
}
}
Part5: Bring it all together
Scripts activated here
{{jsv_setLandingPageHit - TRUE}}
Wins
1. No need to email 1000 Affiliates to re-tag links!
2. No IT dept involvement (all done in GTM)
3. Better cookie retention vs Affiliate cookies
(esp. on Safari)
4. Better internal trust & actionability in GA data
5. Free!
Next iteration
1. Engagement scoring per AffilaiteID
2. utilise affiliateId/gaClientId cross-domain
tracking and better affiliateId retention
3. CRM integration (similar to utmz method)
4. MeasurementProtocol 4 qualified affiliate sales
5. utm_userid respawn on mailchimp email
Questions & Prizes
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).
bit.ly/gtmdevguide2 (free)
Prize: GTM developer guide
free!!
bit.ly/gtmdevguide2

Weitere ähnliche Inhalte

Was ist angesagt?

Plan a Digital Analytics Training Strategy for an Analytics Agency
Plan a Digital Analytics Training Strategy for an Analytics AgencyPlan a Digital Analytics Training Strategy for an Analytics Agency
Plan a Digital Analytics Training Strategy for an Analytics AgencyPhil Pearce
 
4 clicks 2 Measurement - Analytics Automation @ SuperWeek
4 clicks 2 Measurement - Analytics Automation @ SuperWeek4 clicks 2 Measurement - Analytics Automation @ SuperWeek
4 clicks 2 Measurement - Analytics Automation @ SuperWeekPhil Pearce
 
29 Advanced Google Tag Manager Tips Every Marketer Should Know
29 Advanced Google Tag Manager Tips Every Marketer Should Know29 Advanced Google Tag Manager Tips Every Marketer Should Know
29 Advanced Google Tag Manager Tips Every Marketer Should KnowMike Arnesen
 
Analytics Tools to improve Customer Insight
Analytics Tools to improve Customer InsightAnalytics Tools to improve Customer Insight
Analytics Tools to improve Customer InsightPhil Pearce
 
Google Data Studio - First impressions @ Measurecamp
Google Data Studio - First impressions @ MeasurecampGoogle Data Studio - First impressions @ Measurecamp
Google Data Studio - First impressions @ MeasurecampPhil Pearce
 
How can a data layer help my seo
How can a data layer help my seoHow can a data layer help my seo
How can a data layer help my seoPhil Pearce
 
CRO analytics - How to Continually Optimise
CRO analytics - How to Continually OptimiseCRO analytics - How to Continually Optimise
CRO analytics - How to Continually OptimisePhil Pearce
 
Blackhat Analytics 3 @ superweek - Do be evil: Force awakens
Blackhat Analytics 3 @  superweek - Do be evil: Force awakensBlackhat Analytics 3 @  superweek - Do be evil: Force awakens
Blackhat Analytics 3 @ superweek - Do be evil: Force awakensPhil Pearce
 
GTM Tools Checklist
GTM Tools ChecklistGTM Tools Checklist
GTM Tools ChecklistPhil Pearce
 
Benefits of Google Tag Manager
Benefits of Google Tag ManagerBenefits of Google Tag Manager
Benefits of Google Tag ManagerPhil Pearce
 
Google Tag Manager For Nerds
Google Tag Manager For NerdsGoogle Tag Manager For Nerds
Google Tag Manager For NerdsSimo Ahava
 
Google tag manager fundamentals question and answer (june 23 and july 24, 2015)
Google tag manager fundamentals question and answer (june 23 and july 24, 2015)Google tag manager fundamentals question and answer (june 23 and july 24, 2015)
Google tag manager fundamentals question and answer (june 23 and july 24, 2015)Mahendra Patel
 
Rendering SEO (explained by Google's Martin Splitt)
Rendering SEO (explained by Google's Martin Splitt)Rendering SEO (explained by Google's Martin Splitt)
Rendering SEO (explained by Google's Martin Splitt)Anton Shulke
 
Track Everything with Google Tag Manager - #DFWSEM May 2017
Track Everything with Google Tag Manager -  #DFWSEM May 2017Track Everything with Google Tag Manager -  #DFWSEM May 2017
Track Everything with Google Tag Manager - #DFWSEM May 2017Ruth Burr Reedy
 
Introduction To Developing Custom Actions Within SharePoint
Introduction To Developing Custom Actions Within SharePointIntroduction To Developing Custom Actions Within SharePoint
Introduction To Developing Custom Actions Within SharePointGeoff Varosky
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Startedguest1af57e
 
Build Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje JurišićBuild Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje JurišićMeetMagentoNY2014
 
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014Bastian Grimm
 
Challenges of building a search engine like web rendering service
Challenges of building a search engine like web rendering serviceChallenges of building a search engine like web rendering service
Challenges of building a search engine like web rendering serviceGiacomo Zecchini
 

Was ist angesagt? (20)

Plan a Digital Analytics Training Strategy for an Analytics Agency
Plan a Digital Analytics Training Strategy for an Analytics AgencyPlan a Digital Analytics Training Strategy for an Analytics Agency
Plan a Digital Analytics Training Strategy for an Analytics Agency
 
4 clicks 2 Measurement - Analytics Automation @ SuperWeek
4 clicks 2 Measurement - Analytics Automation @ SuperWeek4 clicks 2 Measurement - Analytics Automation @ SuperWeek
4 clicks 2 Measurement - Analytics Automation @ SuperWeek
 
29 Advanced Google Tag Manager Tips Every Marketer Should Know
29 Advanced Google Tag Manager Tips Every Marketer Should Know29 Advanced Google Tag Manager Tips Every Marketer Should Know
29 Advanced Google Tag Manager Tips Every Marketer Should Know
 
Analytics Tools to improve Customer Insight
Analytics Tools to improve Customer InsightAnalytics Tools to improve Customer Insight
Analytics Tools to improve Customer Insight
 
Google Data Studio - First impressions @ Measurecamp
Google Data Studio - First impressions @ MeasurecampGoogle Data Studio - First impressions @ Measurecamp
Google Data Studio - First impressions @ Measurecamp
 
How can a data layer help my seo
How can a data layer help my seoHow can a data layer help my seo
How can a data layer help my seo
 
CRO analytics - How to Continually Optimise
CRO analytics - How to Continually OptimiseCRO analytics - How to Continually Optimise
CRO analytics - How to Continually Optimise
 
Blackhat Analytics 3 @ superweek - Do be evil: Force awakens
Blackhat Analytics 3 @  superweek - Do be evil: Force awakensBlackhat Analytics 3 @  superweek - Do be evil: Force awakens
Blackhat Analytics 3 @ superweek - Do be evil: Force awakens
 
GTM Tools Checklist
GTM Tools ChecklistGTM Tools Checklist
GTM Tools Checklist
 
Benefits of Google Tag Manager
Benefits of Google Tag ManagerBenefits of Google Tag Manager
Benefits of Google Tag Manager
 
Google Tag Manager For Nerds
Google Tag Manager For NerdsGoogle Tag Manager For Nerds
Google Tag Manager For Nerds
 
Google tag manager fundamentals question and answer (june 23 and july 24, 2015)
Google tag manager fundamentals question and answer (june 23 and july 24, 2015)Google tag manager fundamentals question and answer (june 23 and july 24, 2015)
Google tag manager fundamentals question and answer (june 23 and july 24, 2015)
 
Rendering SEO (explained by Google's Martin Splitt)
Rendering SEO (explained by Google's Martin Splitt)Rendering SEO (explained by Google's Martin Splitt)
Rendering SEO (explained by Google's Martin Splitt)
 
Track Everything with Google Tag Manager - #DFWSEM May 2017
Track Everything with Google Tag Manager -  #DFWSEM May 2017Track Everything with Google Tag Manager -  #DFWSEM May 2017
Track Everything with Google Tag Manager - #DFWSEM May 2017
 
Introduction To Developing Custom Actions Within SharePoint
Introduction To Developing Custom Actions Within SharePointIntroduction To Developing Custom Actions Within SharePoint
Introduction To Developing Custom Actions Within SharePoint
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Started
 
Build Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje JurišićBuild Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje Jurišić
 
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
 
Challenges of building a search engine like web rendering service
Challenges of building a search engine like web rendering serviceChallenges of building a search engine like web rendering service
Challenges of building a search engine like web rendering service
 
HTML5
HTML5HTML5
HTML5
 

Ähnlich wie Morphing GA into an Affiliate Analytics Monster

07 cookies
07 cookies07 cookies
07 cookiessnopteck
 
All about google tag manager - Basics
All about google tag manager - Basics All about google tag manager - Basics
All about google tag manager - Basics Rob Levish
 
Having fun with Google Tag Manager (implement cool things like weather tracki...
Having fun with Google Tag Manager (implement cool things like weather tracki...Having fun with Google Tag Manager (implement cool things like weather tracki...
Having fun with Google Tag Manager (implement cool things like weather tracki...Eventz.Digital
 
Google Optimize for testing and personalization
Google Optimize for testing and personalizationGoogle Optimize for testing and personalization
Google Optimize for testing and personalizationOWOX BI
 
DevFest Chiang Mai - Implementing Google Analytics - 2011-09-24.ppt
DevFest Chiang Mai - Implementing Google Analytics - 2011-09-24.pptDevFest Chiang Mai - Implementing Google Analytics - 2011-09-24.ppt
DevFest Chiang Mai - Implementing Google Analytics - 2011-09-24.pptVinoaj Vijeyakumaar
 
implemetning google analytics - 2011-09-24 Google Devfest Chiangmai
implemetning google analytics - 2011-09-24 Google Devfest Chiangmaiimplemetning google analytics - 2011-09-24 Google Devfest Chiangmai
implemetning google analytics - 2011-09-24 Google Devfest ChiangmaiPawoot (Pom) Pongvitayapanu
 
DevFest Kuala Lumpur - Implementing Google Analytics - 2011-09-29.ppt
DevFest Kuala Lumpur - Implementing Google Analytics - 2011-09-29.pptDevFest Kuala Lumpur - Implementing Google Analytics - 2011-09-29.ppt
DevFest Kuala Lumpur - Implementing Google Analytics - 2011-09-29.pptVinoaj Vijeyakumaar
 
Questioning Data Quality and Troubleshooting Tracking Gaps (SMX Munich 2020)
Questioning Data Quality and Troubleshooting Tracking Gaps (SMX Munich 2020)Questioning Data Quality and Troubleshooting Tracking Gaps (SMX Munich 2020)
Questioning Data Quality and Troubleshooting Tracking Gaps (SMX Munich 2020)Christopher Gutknecht
 
How to Pass the Google Analytics Individual Qualification Test by Slingshot SEO
How to Pass the  Google Analytics Individual Qualification Test by Slingshot SEOHow to Pass the  Google Analytics Individual Qualification Test by Slingshot SEO
How to Pass the Google Analytics Individual Qualification Test by Slingshot SEOAarif Nazir
 
GTUG Philippines - Implementing Google Analytics - 2011-10-11
GTUG Philippines - Implementing Google Analytics - 2011-10-11GTUG Philippines - Implementing Google Analytics - 2011-10-11
GTUG Philippines - Implementing Google Analytics - 2011-10-11Vinoaj Vijeyakumaar
 
Expert Tips and Techniques for Using Google Tag Manager
Expert Tips and Techniques  for Using Google Tag ManagerExpert Tips and Techniques  for Using Google Tag Manager
Expert Tips and Techniques for Using Google Tag ManagerOWOX BI
 
Questioning data quality and troubleshooting tracking gaps (version2 | Smx Su...
Questioning data quality and troubleshooting tracking gaps (version2 | Smx Su...Questioning data quality and troubleshooting tracking gaps (version2 | Smx Su...
Questioning data quality and troubleshooting tracking gaps (version2 | Smx Su...Christopher Gutknecht
 
Мастеркласс по GTM на Google Event
Мастеркласс по GTM на Google EventМастеркласс по GTM на Google Event
Мастеркласс по GTM на Google EventKirill Bushev
 
Blackhat Analytics - DarkScore test to printout
Blackhat Analytics - DarkScore test to printoutBlackhat Analytics - DarkScore test to printout
Blackhat Analytics - DarkScore test to printoutPhil Pearce
 
Reutov, yunusov, nagibin random numbers take ii
Reutov, yunusov, nagibin   random numbers take iiReutov, yunusov, nagibin   random numbers take ii
Reutov, yunusov, nagibin random numbers take iiDefconRussia
 
Blackhat Analytics 2 @ Superweek
Blackhat Analytics 2  @ SuperweekBlackhat Analytics 2  @ Superweek
Blackhat Analytics 2 @ SuperweekPhil Pearce
 
Consent mode - from zero to hero
Consent mode - from zero to heroConsent mode - from zero to hero
Consent mode - from zero to heroMichal Blažek
 
Google Analytics for Beginners - Training
Google Analytics for Beginners - TrainingGoogle Analytics for Beginners - Training
Google Analytics for Beginners - TrainingRuben Vezzoli
 

Ähnlich wie Morphing GA into an Affiliate Analytics Monster (20)

07 cookies
07 cookies07 cookies
07 cookies
 
All about google tag manager - Basics
All about google tag manager - Basics All about google tag manager - Basics
All about google tag manager - Basics
 
Having fun with Google Tag Manager (implement cool things like weather tracki...
Having fun with Google Tag Manager (implement cool things like weather tracki...Having fun with Google Tag Manager (implement cool things like weather tracki...
Having fun with Google Tag Manager (implement cool things like weather tracki...
 
Google Optimize for testing and personalization
Google Optimize for testing and personalizationGoogle Optimize for testing and personalization
Google Optimize for testing and personalization
 
DevFest Chiang Mai - Implementing Google Analytics - 2011-09-24.ppt
DevFest Chiang Mai - Implementing Google Analytics - 2011-09-24.pptDevFest Chiang Mai - Implementing Google Analytics - 2011-09-24.ppt
DevFest Chiang Mai - Implementing Google Analytics - 2011-09-24.ppt
 
implemetning google analytics - 2011-09-24 Google Devfest Chiangmai
implemetning google analytics - 2011-09-24 Google Devfest Chiangmaiimplemetning google analytics - 2011-09-24 Google Devfest Chiangmai
implemetning google analytics - 2011-09-24 Google Devfest Chiangmai
 
DevFest Kuala Lumpur - Implementing Google Analytics - 2011-09-29.ppt
DevFest Kuala Lumpur - Implementing Google Analytics - 2011-09-29.pptDevFest Kuala Lumpur - Implementing Google Analytics - 2011-09-29.ppt
DevFest Kuala Lumpur - Implementing Google Analytics - 2011-09-29.ppt
 
Questioning Data Quality and Troubleshooting Tracking Gaps (SMX Munich 2020)
Questioning Data Quality and Troubleshooting Tracking Gaps (SMX Munich 2020)Questioning Data Quality and Troubleshooting Tracking Gaps (SMX Munich 2020)
Questioning Data Quality and Troubleshooting Tracking Gaps (SMX Munich 2020)
 
How to Pass the Google Analytics Individual Qualification Test by Slingshot SEO
How to Pass the  Google Analytics Individual Qualification Test by Slingshot SEOHow to Pass the  Google Analytics Individual Qualification Test by Slingshot SEO
How to Pass the Google Analytics Individual Qualification Test by Slingshot SEO
 
GTUG Philippines - Implementing Google Analytics - 2011-10-11
GTUG Philippines - Implementing Google Analytics - 2011-10-11GTUG Philippines - Implementing Google Analytics - 2011-10-11
GTUG Philippines - Implementing Google Analytics - 2011-10-11
 
Expert Tips and Techniques for Using Google Tag Manager
Expert Tips and Techniques  for Using Google Tag ManagerExpert Tips and Techniques  for Using Google Tag Manager
Expert Tips and Techniques for Using Google Tag Manager
 
Questioning data quality and troubleshooting tracking gaps (version2 | Smx Su...
Questioning data quality and troubleshooting tracking gaps (version2 | Smx Su...Questioning data quality and troubleshooting tracking gaps (version2 | Smx Su...
Questioning data quality and troubleshooting tracking gaps (version2 | Smx Su...
 
Мастеркласс по GTM на Google Event
Мастеркласс по GTM на Google EventМастеркласс по GTM на Google Event
Мастеркласс по GTM на Google Event
 
Blackhat Analytics - DarkScore test to printout
Blackhat Analytics - DarkScore test to printoutBlackhat Analytics - DarkScore test to printout
Blackhat Analytics - DarkScore test to printout
 
Reutov, yunusov, nagibin random numbers take ii
Reutov, yunusov, nagibin   random numbers take iiReutov, yunusov, nagibin   random numbers take ii
Reutov, yunusov, nagibin random numbers take ii
 
Random numbers
Random numbersRandom numbers
Random numbers
 
Blackhat Analytics 2 @ Superweek
Blackhat Analytics 2  @ SuperweekBlackhat Analytics 2  @ Superweek
Blackhat Analytics 2 @ Superweek
 
Consent mode - from zero to hero
Consent mode - from zero to heroConsent mode - from zero to hero
Consent mode - from zero to hero
 
Google Analytics for Beginners - Training
Google Analytics for Beginners - TrainingGoogle Analytics for Beginners - Training
Google Analytics for Beginners - Training
 
Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessions
 

Mehr von Phil Pearce

Photos of LaserBowling @ MeasureCamp Cardiff 2
Photos of LaserBowling @ MeasureCamp Cardiff 2Photos of LaserBowling @ MeasureCamp Cardiff 2
Photos of LaserBowling @ MeasureCamp Cardiff 2Phil Pearce
 
Measurebowling Nerdshirts 2017-06-08
Measurebowling Nerdshirts 2017-06-08Measurebowling Nerdshirts 2017-06-08
Measurebowling Nerdshirts 2017-06-08Phil Pearce
 
The Kamasutra of GTM container positions
The Kamasutra of GTM container positionsThe Kamasutra of GTM container positions
The Kamasutra of GTM container positionsPhil Pearce
 
Common mistakes with media tagging (utm tags) and how to fix them!
Common mistakes with media tagging (utm tags) and how to fix them!Common mistakes with media tagging (utm tags) and how to fix them!
Common mistakes with media tagging (utm tags) and how to fix them!Phil Pearce
 
QR code uses cases & Digital Marketing podcasts
QR code uses cases & Digital Marketing podcastsQR code uses cases & Digital Marketing podcasts
QR code uses cases & Digital Marketing podcastsPhil Pearce
 
Analytics Crystal maze
Analytics Crystal mazeAnalytics Crystal maze
Analytics Crystal mazePhil Pearce
 
Example cookie compliance audit
Example cookie compliance auditExample cookie compliance audit
Example cookie compliance auditPhil Pearce
 
Example SEO audit
Example SEO auditExample SEO audit
Example SEO auditPhil Pearce
 
Clicktale Vendor Privacy Audit (August 2013)
Clicktale Vendor Privacy Audit (August 2013)Clicktale Vendor Privacy Audit (August 2013)
Clicktale Vendor Privacy Audit (August 2013)Phil Pearce
 
SEO analytics: How to report & improve performance
SEO analytics: How to report & improve performanceSEO analytics: How to report & improve performance
SEO analytics: How to report & improve performancePhil Pearce
 
Analytics & Optimisation for University sites
Analytics & Optimisation for University sitesAnalytics & Optimisation for University sites
Analytics & Optimisation for University sitesPhil Pearce
 
Digital analytics upskilling & career tips
Digital analytics upskilling & career tipsDigital analytics upskilling & career tips
Digital analytics upskilling & career tipsPhil Pearce
 
Hard PPC questions for the Panel
Hard PPC questions for the PanelHard PPC questions for the Panel
Hard PPC questions for the PanelPhil Pearce
 
Google Tag Manager Flash Tips @ MeasureCamp
Google Tag Manager Flash Tips @ MeasureCampGoogle Tag Manager Flash Tips @ MeasureCamp
Google Tag Manager Flash Tips @ MeasureCampPhil Pearce
 
Realtime Google Analytics game
Realtime Google Analytics gameRealtime Google Analytics game
Realtime Google Analytics gamePhil Pearce
 
Top 10 Google Analytics tips to save you money!
Top 10 Google Analytics tips to save you money!Top 10 Google Analytics tips to save you money!
Top 10 Google Analytics tips to save you money!Phil Pearce
 
Monetate Implementation Cheat Sheet
Monetate Implementation Cheat SheetMonetate Implementation Cheat Sheet
Monetate Implementation Cheat SheetPhil Pearce
 

Mehr von Phil Pearce (17)

Photos of LaserBowling @ MeasureCamp Cardiff 2
Photos of LaserBowling @ MeasureCamp Cardiff 2Photos of LaserBowling @ MeasureCamp Cardiff 2
Photos of LaserBowling @ MeasureCamp Cardiff 2
 
Measurebowling Nerdshirts 2017-06-08
Measurebowling Nerdshirts 2017-06-08Measurebowling Nerdshirts 2017-06-08
Measurebowling Nerdshirts 2017-06-08
 
The Kamasutra of GTM container positions
The Kamasutra of GTM container positionsThe Kamasutra of GTM container positions
The Kamasutra of GTM container positions
 
Common mistakes with media tagging (utm tags) and how to fix them!
Common mistakes with media tagging (utm tags) and how to fix them!Common mistakes with media tagging (utm tags) and how to fix them!
Common mistakes with media tagging (utm tags) and how to fix them!
 
QR code uses cases & Digital Marketing podcasts
QR code uses cases & Digital Marketing podcastsQR code uses cases & Digital Marketing podcasts
QR code uses cases & Digital Marketing podcasts
 
Analytics Crystal maze
Analytics Crystal mazeAnalytics Crystal maze
Analytics Crystal maze
 
Example cookie compliance audit
Example cookie compliance auditExample cookie compliance audit
Example cookie compliance audit
 
Example SEO audit
Example SEO auditExample SEO audit
Example SEO audit
 
Clicktale Vendor Privacy Audit (August 2013)
Clicktale Vendor Privacy Audit (August 2013)Clicktale Vendor Privacy Audit (August 2013)
Clicktale Vendor Privacy Audit (August 2013)
 
SEO analytics: How to report & improve performance
SEO analytics: How to report & improve performanceSEO analytics: How to report & improve performance
SEO analytics: How to report & improve performance
 
Analytics & Optimisation for University sites
Analytics & Optimisation for University sitesAnalytics & Optimisation for University sites
Analytics & Optimisation for University sites
 
Digital analytics upskilling & career tips
Digital analytics upskilling & career tipsDigital analytics upskilling & career tips
Digital analytics upskilling & career tips
 
Hard PPC questions for the Panel
Hard PPC questions for the PanelHard PPC questions for the Panel
Hard PPC questions for the Panel
 
Google Tag Manager Flash Tips @ MeasureCamp
Google Tag Manager Flash Tips @ MeasureCampGoogle Tag Manager Flash Tips @ MeasureCamp
Google Tag Manager Flash Tips @ MeasureCamp
 
Realtime Google Analytics game
Realtime Google Analytics gameRealtime Google Analytics game
Realtime Google Analytics game
 
Top 10 Google Analytics tips to save you money!
Top 10 Google Analytics tips to save you money!Top 10 Google Analytics tips to save you money!
Top 10 Google Analytics tips to save you money!
 
Monetate Implementation Cheat Sheet
Monetate Implementation Cheat SheetMonetate Implementation Cheat Sheet
Monetate Implementation Cheat Sheet
 

Kürzlich hochgeladen

Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...amitlee9823
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...amitlee9823
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...only4webmaster01
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...amitlee9823
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...amitlee9823
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...amitlee9823
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 

Kürzlich hochgeladen (20)

Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 

Morphing GA into an Affiliate Analytics Monster

  • 1. Morphing GA into an Affiliate Analytics Monster By Phil Pearce #MeasureCamp @PHILPEARCE London 25th March 2017
  • 2. Warning / Disclaimer 1. GA is design for audience measurement (not affiliates tracking) 2. Run this on a parallel GA account (not your main GA account) as it will report very different numbers and use _ga2 cookie. 3. This is not a simple process…
  • 3. Pls Download and import this GTM file: bit.ly/affiliatemonsterdownload Or use this generic login: username: coolgtmstuff@gmail.com password: philrulesgtm7 Select "Affiliate Monster container" Working Demo
  • 4. …but, I like to push the boundaries of what`s possible (with GA)…
  • 5. …and I`m a slightly Mad Analytics Scientist!
  • 6. Note: It has taken lots of <body>s to get to this point…
  • 7. GTM <body>`s from the past...
  • 8. But it worked! and… the data came alive :)
  • 11. Agenda 1. Define the problem – Business Alignment (custom business logic in affiliate industry) – 1st party vs 3rd party cookies – GA is whitelisted on Adblocker plus – Existing affiliateId=123 params ignored by GA (and utm_id not used by affiliates) 2. Solution – Mapping affiliateId to utm_id – Overwriting setLocation & setReferral – DimensionWidening via CSV upload of affiliateId >> source/medium/campaign 3. Learnings/Mistakes – Enabling utm campaign cookie to prevent session reset on 2nd page – Accounting for #utm vs ?utm 4. Future improvements – Organic and Social organic cookie – Cross-domain tracking of source and affiliateId (#_ga=xxx.xxx pigybacking) – GoogleSheet for affiliateId DimensionWidening 5. Questions
  • 12. This is the story of one such mad Analytics Experiment…
  • 13. So, new super-affiliate client just signed! • GA classic >> GA universal migration via GTM • 5 CMS environments (Desktop, New Mobile, Old mobile site, Tablet, Campaign Site) • utm tags only used on email and banners • Affiliates 90% of traffic but missing utm tags. Hence, Direct was 80% of traffic! • Marketing Channel Analysis not possible in GA!!
  • 14. Source: builtwith.com/detailed/behemothclient.com 5 CMS platforms: Desktop, New Mobile, Old mobile site, Tablet and Campaign Site. Cleaning & Standardise Equipment before the big operation
  • 15. Testing on Mice 1. Parallel Tracker 2. Unit Tests & Sinario Tests 3. Query Time utm_id widening
  • 16. Alive indefinitely Unit Test / Mice Test Code Refinements 1 day Live test Standardise GTM SetupAffiliate Monster Project Timeline 3 months bring the beast to life
  • 17. In Reality… It was really hard! Insert Picture of - Phil with no hair and - lots of dead mice
  • 18. But we did get there :) But about those dead mice…
  • 19. Why not use native GA? 1. setSource utm field (rather than setLocation) 2. Custom Multi-channel funnels 3. BigQuery sessionisation [GA Prem. feature] 4. GA 6 mth sessions setting changed to 30days 5. utm_nooveride=1 not used
  • 20. Recipe for a Affiliate Monster 1. Have GTM on all pages 2. Declare affiliateTracker name 3. Declare ga2 object 4. Declare ga2 cookie 5. setLocation override in pageview 6. setReferral override in pageview 7. Be on SSL (or enable meta always send referral)
  • 21. Mistakes to Avoid 1. cleaning/removing existing utm params 2. Accounting for the order of params 3. #utm vs ?utm or both 4. removing double-quotes 5. JS logic: gclid/dclid >> utm >> affiliateId >> organic >> social referral >> referral
  • 22. Pls Download and import this GTM file: bit.ly/affiliatemonsterdownload Or use this generic login: username: coolgtmstuff@gmail.com password: philrulesgtm7 Select "Affiliate Monster container" Working Demo
  • 23. part1: jsv_pageHostnameTLD function(){ var domain={{Page Hostname - www removed}}; var rootDomain = undefined; if (domain) { domain.toLowerCase(); } if (domain.substring(0,4)=="www.") { domain=domain.substring(4,domain.length); } var domParts = domain.split('.'); for(var i=1;i<=domParts.length;i++) { document.cookie="gtmtestcookie1=1; path=/; domain="+domParts.slice(i*-1).join('.'); if(document.cookie.indexOf("gtmtestcookie1") != -1){ var rootDomain = domParts.slice(i*-1).join('.'); document.cookie="gtmtestcookie1=1; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/; domain="+domParts.slice(i*-1).join('.'); break; } } return rootDomain; }
  • 24. part2: setCookie for utm_id setTrackingSessionCookie <script> function setTrackingSessionCookie(trackingCookieName, cookieValue, cookieDaysDuration) { var pageHostnameTLD = {{jsv_pageHostnameTLD}}; var cookieExpires = ""; if (cookieDaysDuration) { var date = new Date(); date.setTime(date.getTime() + (cookieDaysDuration *24*60*60*1000) ); cookieExpires = "; expires=" + date.toGMTString(); // If not provided, it will be a session cookie. } // Session SetCookie if (trackingCookieName && cookieValue) { document.cookie = trackingCookieName + '=' + cookieValue + cookieExpires + '; domain=' + pageHostnameTLD + '; path=/'; } }; // Set Based on URL or URL Hash setTrackingSessionCookie("gclid", {{Page URL Query tracking gclid}} , "30"); setTrackingSessionCookie("dclid", {{Page URL Query tracking dclid}} , "30"); setTrackingSessionCookie("utm_id", {{Page URL Query tracking utm_id}} , "30"); setTrackingSessionCookie("utm_source", {{Page URL Query tracking utm_source}} , "30"); setTrackingSessionCookie("utm_medium", {{Page URL Query tracking utm_medium}} , "30"); setTrackingSessionCookie("utm_campaign", {{Page URL Query tracking utm_campaign}} , "30"); setTrackingSessionCookie("utm_content", {{Page URL Query tracking utm_content}} , "30"); setTrackingSessionCookie("utm_keyword", {{Page URL Query tracking utm_keyword}} , "30"); setTrackingSessionCookie("utm_userid", {{Page URL Query tracking utm_userid}} , "30"); </script>
  • 25. part3: setLocation <script> function setTrackingLocation() { var pageProtocol = {{Page URL Protocol}}; var pageHostname = {{Page Hostname}}; var pagePath = {{Page Path}}; var pageQuery = {{Page URL Query}}; var referrerHostname = {{Referrer Hostname - www removed}}; var countryCode = {{Lookup CountryCode from Country1 - PP reminder to check DE SH or DESH or SH}}; var deviceType = {{Lookup bespokeDeviceCategory from ContainerID}}; var cookieGoogleClickid = {{cookie gclid}}; var cookieDoubleClickId = {{cookie dclid}}; var cookieUtmId = {{cookie utm_id}}; var cookieUtmSource = {{cookie utm_source}}; var cookieUtmMedium = {{cookie utm_medium}}; var cookieUtmCampaign = {{cookie utm_campaign}}; var cookieUtmContent = {{cookie utm_content}}; var cookieUtmKeyword = {{cookie utm_keyword}}; var cookieAffiliateId = {{cookie affiliateId}}; var cookieIsLandingPageHit = {{cookie session gtm_isLandingPageHit}}; cookieIsLandingPageHit = ( cookieIsLandingPageHit == undefined ) ? "true" : "false"; // 0. Remove double-quote within utm tags... ""textlink"/adcash" to "textlink/adcash" // 0. Change undefined to empty string so no risk of "utm_source=undefined" pageQuery = (typeof pageQuery !== 'undefined') ? pageQuery.replace(/["]+/g, '') : ""; cookieAffiliateId = (typeof cookieAffiliateId !== 'undefined') ? cookieAffiliateId.replace(/["]+/g, '') : ""; cookieUtmId = (typeof cookieUtmId !== 'undefined') ? cookieUtmId.replace(/["]+/g, '') : ""; cookieUtmSource = (typeof cookieUtmSource !== 'undefined') ? cookieUtmSource.replace(/["]+/g, '') : ""; cookieUtmMedium = (typeof cookieUtmMedium !== 'undefined') ? cookieUtmMedium.replace(/["]+/g, '') : ""; cookieUtmCampaign = (typeof cookieUtmCampaign !== 'undefined') ? cookieUtmCampaign.replace(/["]+/g, '') : ""; cookieUtmContent = (typeof cookieUtmContent !== 'undefined') ? cookieUtmContent.replace(/["]+/g, '') : ""; cookieUtmKeyword = (typeof cookieUtmKeyword !== 'undefined') ? cookieUtmKeyword.replace(/["]+/g, '') : "";
  • 27. part5: isLandingPageHit function() { return function() { setTrackingSessionCookie("gtm_isLandingPageHit", "false"); } }
  • 28. Part5: Bring it all together Scripts activated here {{jsv_setLandingPageHit - TRUE}}
  • 29. Wins 1. No need to email 1000 Affiliates to re-tag links! 2. No IT dept involvement (all done in GTM) 3. Better cookie retention vs Affiliate cookies (esp. on Safari) 4. Better internal trust & actionability in GA data 5. Free!
  • 30. Next iteration 1. Engagement scoring per AffilaiteID 2. utilise affiliateId/gaClientId cross-domain tracking and better affiliateId retention 3. CRM integration (similar to utmz method) 4. MeasurementProtocol 4 qualified affiliate sales 5. utm_userid respawn on mailchimp email
  • 31. Questions & Prizes 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).
  • 32. bit.ly/gtmdevguide2 (free) Prize: GTM developer guide free!! bit.ly/gtmdevguide2