Mobile app version of vmapp.org
Login or Join
Angela700

: 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

@Angela700

Posted in: #Analytics #GoogleAnalytics #UniversalAnalytics

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.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Angela700

2 Comments

Sorted by latest first Latest Oldest Best

 

@Hamm4606531

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

10% popularity Vote Up Vote Down


 

@Eichhorn148

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme