/optimize/community?hl=en
This content is likely not relevant anymore. Try searching or browse recent questions.
How to get referrer of entry page for Redirect tests? Ours is showing incorrect referrer data. 1 Recommended Answer 9 Replies 2 Upvotes
1 Recommended Answer
$0 Recommended Answers
1 Relevant Answer
$0 Relevant Answers
When running a redirect test, the document.referrer data is the "original" page and never the entry page. For example:

Coming from www.stackoverflow.com => www.mywebsite.com => www.mywebsite.com/mytest/

The document.referrer should be "stackoverflow.com" but it's showing up as "www.mywebsite.com". From my understanding, redirects should pass referrer data through to the final page, right?

I've also seen discussion in this forum claiming the experiment should pass a "utm_referrer" in the url that is used by Google Analytics to accurately track referrer data. This isn't showing up in our redirect experiments and I'm not sure it would anymore given how Google recently changed the implementation to hide URL params.

Is anyone else having this issue?
Details
Relevant Answer Relevant Answers (0)
All Replies (9)
Relevant Answer
There is a bug on Optimize side where the referrer of a redirect experiment is not tracked correctly if Optimize is installed using the analytics.js installation method. It would work correctly if you use the optimize.js version of the snippet.
marked this as an answer
Relevant Answer
Thanks for the reply. I'm confused, that link lists two optimize.js installation methods, sync and async. I don't see anything about an analytics.js installation method?

We're using GTM to serve the Optimize code and according to the documentation you shared, this is the correct way. Does the GTM Optimize tag use analytics.js?
marked this as an answer
Relevant Answer
Update: I replaced the Optimize tag with a custom tag using the optimize.js sync snippet and this did not fix the incorrect referrer information. It still shows the original variant as the referrer and not the entry page.

Is this bug documented somewhere with more detail? I'd imagine this is a big problem for a lot of people.
marked this as an answer
Relevant Answer
With the optimize.js installation, analytics should be just installed using standard gtag snippet or GTM separate from the Optimize installation.

Implementing the optimize.js sync snippet in GTM makes the script async and it's not guaranteed to run before GTM sending out pageview to GA in the original page. The sync version of the optimize.js snippet needs to be installed in the page before the GTM snippet.

Also the redirect experiment does not and can not change document.referrer. It only changes how referrer are tracked in GA. If your Optimize installation is using GTM, you should not have the referrer problem in GA. You need to check GA to see if the traffic source for your experiment sessions are correct.
marked this as an answer
This question is locked and replying has been disabled.
Discard post? You will lose what you have written so far.
Write a reply
10 characters required
Failed to attach file, click here to try again.
Discard post?
You will lose what you have written so far.
Personal information found

We found the following personal information in your message:

This information will be visible to anyone who visits or subscribes to notifications for this post. Are you sure you want to continue?

A problem occurred. Please try again.
Create Reply
Edit Reply
Delete post?
This will remove the reply from the Answers section.
Notifications are off
Your notifications are currently off and you won't receive subscription updates. To turn them on, go to Notifications preferences on your Profile page.
Report abuse
Google takes abuse of its services very seriously. We're committed to dealing with such abuse according to the laws in your country of residence. When you submit a report, we'll investigate it and take the appropriate action. We'll get back to you only if we require additional details or have more information to share.

Go to the Legal Help page to request content changes for legal reasons.

Reported post for abuse
Unable to send report.
Report post
What type of post are you reporting?
Google takes abuse of its services very seriously. We're committed to dealing with such abuse according to the laws in your country of residence. When you submit a report, we'll investigate it and take the appropriate action. We'll get back to you only if we require additional details or have more information to share.

Go to the Legal Help page to request content changes for legal reasons.

Reported post for abuse
Unable to send report.
This reply is no longer available.
/optimize/threads
//accounts.google.com/ServiceLogin
You'll receive email notifications for new posts at
Unable to delete question.
Unable to update vote.
Unable to update subscription.
You have been unsubscribed
Deleted
Unable to delete reply.
Removed from Answers
Marked as Recommended Answer
Removed recommendation
Undo
Unable to update reply.
Unable to update vote.
Thank you. Your response was recorded.
Unable to undo vote.
Thank you. This reply will now display in the answers section.
Link copied
Locked
Unlocked
Unable to lock
Unable to unlock
Pinned
Unpinned
Unable to pin
Unable to unpin
Marked
Unmarked
Unable to mark
Reported as off topic
/optimize/profile/0