How can I overwrite the referrer with an empty string | Community
Skip to main content
Level 3
May 10, 2021
Solved

How can I overwrite the referrer with an empty string

  • May 10, 2021
  • 4 replies
  • 4033 views

Hi,

When a visitor types the URL of page A in the browser a redirect occurs to the page B.
On the B page the URL is b/?ref= and document.referrer=A

I set s.referrer = s.Util.getQueryParam("ref"); however since it's an empty string the value from document.referrer shows up.

Any advice?

Thank You!

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 PratheepArunRaj

Dear Andre,

That's the expected behavior if it is a server redirection. This is because AA referrer will not be set automatically on Page A but only on Page B where the document.referrer is Page A.

For page-level redirections, if the Adobe Analytics call was triggered before the redirection, the AA referrer value will be empty and thus you will see an empty value at the landing page (Here, Page B).

Thank You, Pratheep Arun Raj B | Xerago | Terryn Winter Analytics

4 replies

PratheepArunRaj
Community Advisor and Adobe Champion
PratheepArunRajCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
May 10, 2021

Dear Andre,

That's the expected behavior if it is a server redirection. This is because AA referrer will not be set automatically on Page A but only on Page B where the document.referrer is Page A.

For page-level redirections, if the Adobe Analytics call was triggered before the redirection, the AA referrer value will be empty and thus you will see an empty value at the landing page (Here, Page B).

Thank You, Pratheep Arun Raj B | Xerago | Terryn Winter Analytics

Thank You, Pratheep Arun Raj B (Arun) | Xerago | Terryn Winter Analytics
Level 3
May 10, 2021
Hi Pratheep, agree that is the default expected behavior. That's why I'm using the s.referrer to overwrite the value with an empty string. Somehow the overwrite is not working and I still get the value from document.referrer.
Charles_Thirupathi
Level 4
May 10, 2021

@andreis65119307 If u set s.referrer = s.Util.getQueryParam("ref"); for the url b/?ref= final value of s.referrer will be empty (s.referrer = ' ');, Appmeasurement library will considered this as s.referrer is not defined and it will assign document.referrer as s.referrer value. For avoiding this you can assign the value of as s.referrer="Empty" or s.referrer="none"(string value to be assigned) if s.Util.getQueryParam("ref"); value is null/empty or ' '.

Level 3
May 24, 2021

What if I use the adobe_mc_ref parameter
https://experienceleague.adobe.com/docs/target/using/integrate/a4t/a4t-faq/a4t-faq-redirect-offers.html?lang=en#section_D2A8B182B7254D61A8BB2BCBA0C0F64A

In test it looks like it works, any experience with it for this scenario?

jantzen_b
Adobe Employee
Adobe Employee
May 24, 2021
Do any of the answers below answer your initial question? If so, can you select one of them as the correct answer? If none of the answers already provided answer your question, can you provide additional information to better help the community solve your question?