Expand my Community achievements bar.

SOLVED

How do I set s.referrer as ""?

Avatar

Level 2

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?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

As described here: https://experienceleague.adobe.com/docs/analytics/implementation/vars/page-vars/referrer.html?lang=e... 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.

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

As described here: https://experienceleague.adobe.com/docs/analytics/implementation/vars/page-vars/referrer.html?lang=e... 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.

Avatar

Level 2

@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.

Avatar

Community Advisor

Hmm, I wonder if this is because a blank string is interpreted as "null", which AA then ignores and falls back to using document.referrer.

In that case, could you tweak your "Session Refresh" Marketing Channel Processing Rules? Such that it is set only on the first page of a visit.

Avatar

Level 2

@yuhuisg: Yep, have updated the Marketing Channel Processing Rules as a back up feels 'more right' to try to correct within s.referrer. 

 

Anyways, thanks for you help!