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.

  • Hey @lucgenti, did you ever find a proper solution for this? SEO people made me move the blog from a subdomain to a subfolder, I did so reluctantly, and now they are complaining that they can't see the referrals!
    – Andrew
    Commented Mar 8, 2017 at 17:41

2 Answers 2


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

  • Good to know! I'll try to find out something more about it. Thanks
    – lucgenti
    Commented Apr 4, 2017 at 19:41

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.

  • So the only solution is to use url campaign tracking in every url that comes from my subdirectory? Another thing: I was thinking if I could using some filters. For example, a filter that extract the subdirectory from the URI and output it as a subdomain. For example: example.com/blog would be blog.example.com and so I can take advantage of self-referral problem with subdomain in analytics. I tried to do it but with no success. I don't know if I set it wrong or it's something impossible.
    – lucgenti
    Commented Jan 23, 2015 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.