Google Analytics + Forwarding

I have a first domain that redirects (using page rules) to a second domain. For this to work, it has an A DNS record of 192.0.2.1. The redirecting method is the Forwarding URL with a 301 permanent redirect, if it matters.

This (first) domain has the Google Analytics added using Zaraz tools.

Please confirm this for me, Zaraz will not be able to load the analytics, right?

What I ideally would like to achieve is to get the referrals of the first domain, before it gets forwarded to the second domain. I can’t see it possible though

Correct. The request won’t even get that far due to the 301.

Instead of the Page Rule, you could try creating a Worker that matches route example.com/* with simple HTML that contains a Meta Refresh 0.

Thanks for the info.
I’ve tried that and Zaraz still won’t load the script for me. However, adding the analytics script before a 10 seconds meta refresh worked.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.