Two days ago I added 'paypal.com' to the referral exclusions on the google analytics account for my website.
My website is submitting its data to GA via google tag manager.
So far, yesterday's visits are not excluding paypal as referral.
Do you know if the process of setting the referral exclusions with google tag manager is different than it is for google analytics? do you know how long do the referral exclusions settings take to have any effect?
I sorted this out by implementing the referral exclusion in javascript, right before the gtm tag:
var previousReferrer = Cookies.get("previous_referrer")
if(document.referrer.match(/paypal\.com/))
Object.defineProperty(document,
"referrer",
{get : function(){
return previousReferrer; }});
Cookies.set("previous_referrer", document.URL);
please notice that as it is hard to change the document.referrer
variable we need to use defineProperty
and that this only works in modern browsers (safari <=5, Firefox < 4, Chrome < 5 and Internet Explorer < 9 ):