How do I set s.referrer as ""? | Community
Skip to main content
Level 2
January 12, 2021
Solved

How do I set s.referrer as ""?

  • January 12, 2021
  • 1 reply
  • 2785 views

For cookie compliance, we have to refresh the landing page if a user opts in too Analytics cookies. This causes inflated session refresh visits because document.location is set to our domain. 

 

How do I set s.referrer as "" / null so Adobe believes the marketing channel is direct rather than session refresh?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by yuhuisg

As described here: https://experienceleague.adobe.com/docs/analytics/implementation/vars/page-vars/referrer.html?lang=en#s.referrer-in-appmeasurement-and-launch-custom-code-editor, you can simply use s.referrer = "".

However, you'll need to add your own logic so that this is done only after when the page was loaded immediately after the user has given consent.

1 reply

yuhuisg
Community Advisor
yuhuisgCommunity AdvisorAccepted solution
Community Advisor
January 13, 2021

As described here: https://experienceleague.adobe.com/docs/analytics/implementation/vars/page-vars/referrer.html?lang=en#s.referrer-in-appmeasurement-and-launch-custom-code-editor, you can simply use s.referrer = "".

However, you'll need to add your own logic so that this is done only after when the page was loaded immediately after the user has given consent.

Level 2
January 13, 2021

@yuhuisg : Thanks for your response. I am setting the s.referrer="" post page refresh, before the tag is fired. It keeps defaulting to location.referrer.