: How to report traffic from subdirectory as a referral The /blog/ subdirectory of this website needs to be considered like a subdomain. Different people and different project. So, it would be
The /blog/ subdirectory of this website needs to be considered like a subdomain. Different people and different project.
So, it would be great to considered traffic from this subdirectory as a referral or new source. How can I do that?
Now I have 2 properties: one is only the main website, and the other is website+blog in aggregate. Can I do that in the first one?
I already deleted my domain from the "referral exclusion list", but without success.
More posts by @Angela700
2 Comments
Sorted by latest first Latest Oldest Best
For others looking at this, I came up with this possible solution. You can change the referrer value before you send the page view to google. So something like this might be what you need.
if (document.referrer.includes("example.org/blog/")){
ga('set', 'referrer', document.referrer.replace('example.org/blog', 'exampleblog.org'));
}
ga('send', 'pageview');
This just modifies the referrer if its from the blog, to be a different referring domain.
While this works for my purposes at the moment. I believe this will cause Google Analytics to create an extra session if someone goes from example.com, to example.com/blog, and back to example.com. That is the only side effect I know of atm, there could be more though.
See analytics documentation here
You would actually have to host your blog on a different domain for Google Analytics to consider traffic from it to be external referrer traffic. Google Analytics considers all referrer traffic from the same domain name to be "internal" traffic and does not list it in the acquisition reports.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.