Overwriting the s.referrer | Community
Skip to main content
Ridder_M
Level 2
October 16, 2015
Solved

Overwriting the s.referrer

  • October 16, 2015
  • 4 replies
  • 2766 views

Hello,

I wrote the following code to re-write the s.referrer if they are coming to the site using a tracking code, providing a better indicator of the channel breakdown when looking at the referrer reports, rather than place all of them under the "typed/bookmark" bucket:

if(window.document.URL.indexOf("did") > -1) {

  s.referrer = "display.campaing/"+s.campaign;}
  else if(window.document.URL.indexOf("eid") > -1) {
       s.referrer = "email://email.campaing/"+s.campaign;}
    else if(window.document.URL.indexOf("gid") > -1) {
            s.referrer = "game.campaing/"+s.campaign;}
    else if(window.document.URL.indexOf("sid") > -1) {
            s.referrer = "socialpaid.campaing/"+s.campaign;}
    else if(window.document.URL.indexOf("smid") > -1) {
            s.referrer = "socialmanaged.campaing/"+s.campaign;}                                            
  else if(window.document.URL.indexOf("xid") > -1) {
        s.referrer = "test.campaing/"+s.campaign;}   

The issue that I'm having is that although the s.referrer is re-written, I'm not seeing the data in the UI.  When AppMeasurement was created, does it have a condition that prevents the s.referrer from setting?  Any help will be greatly appreciated.

Thanks,

Ridder H. Manzanet 

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 Gigazelle

Checked the debugger, and the referring URL is indeed being overwritten with the values you're specifying. Logged in and looked in the Referrer report under the report suite this data is going to, and I'm seeing the values that are being reported in the debugger as well.

From what I can tell, there aren't any issues here - unless the issue has since been resolved since this last post, the only culprit that I can think of is viewing the wrong report or report suite.

4 replies

TanmayMathur
Adobe Employee
Adobe Employee
October 16, 2015

Hi,

It would be great if you could share the URL of the website you are implementing on. We can better troubleshoot it.

Thanks,

TM

Gigazelle
Adobe Employee
GigazelleAdobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

Checked the debugger, and the referring URL is indeed being overwritten with the values you're specifying. Logged in and looked in the Referrer report under the report suite this data is going to, and I'm seeing the values that are being reported in the debugger as well.

From what I can tell, there aren't any issues here - unless the issue has since been resolved since this last post, the only culprit that I can think of is viewing the wrong report or report suite.

Ridder_M
Ridder_MAuthor
Level 2
October 16, 2015

Hi Tanmay,

Here's the URL where I'm testing this:  test.manzanet.us

Make sure you are using a query string parameter in the URL, since that's the trigger that I'm using to overwrite the s.referrer.

Thanks,

Ridder H. Manzanet

Ridder_M
Ridder_MAuthor
Level 2
October 16, 2015

Hi Gigazelle,

Yes, in a debugger it shows the value of s.referrer changed, but when looking at either the Referrer Type or Referring Domains report, the value is still "Typed/Bookmark".  Why is the value in the report then not changed to what is in the debugger? 

FYI, this is not yet solved.

Thanks,

Ridder H. Manzanet