Need to Track the reference URL ? | Community
Skip to main content
Ravi_Ansal2
Level 5
May 21, 2015
Solved

Need to Track the reference URL ?

  • May 21, 2015
  • 2 replies
  • 13005 views

Hi Everyone,

I want to track the URL(domain+Reference) from which a lead landed on our page?

I have tried document.referrer script but it is not working properly?

Sometimes it shows the empty URL and sometime it does not provide the whole URL?

Please Help me with this

Best answer by SanfordWhiteman

Sanford, are you saying that when someone is referred to a munchkin tracked web page that uses HTTPS from a Google search where they are logged in to Google (URL's scheme is ), that the Referrer URL will be captured?


Yes, https: -> https: will be captured, AFAIK (let us say, there is no standard prohibition against it as there is with https: -> http:)

Note, however, that this is the true referrer we're talking about.  Google bounces you off their base domain first so the referrer doesn't have the query string -- but that is nonetheless the real referring site. Yahoo will show the full thing.1

ETA: 1 Meaning a network trace of Yahoo traffic shows Y doesn't "massage" the referrer via an interstitial page before JS-redirecting to your site.  Instead they use an HTTP redirect (Google will do the same thing if you have JavaScript disabled, I think).  All standard rules (and possibly non-standard browser implementations) apply from there.

To return to @Ravi Ansal​'s question, the bottom line is there are conditions that Marketo can't workaround where the capital-R Referrer (as in the document.referrer property) isn't available or is truncated so that it isn't as actionable as you want.  Unless you can establish that the full document.referrer is available to JavaScript and yet isn't associated with the web action, I don't think you've found a bug.

ETA: Hope it's cool that I'm editing my Correct Answer, but actually the above remark about Yahoo not using an interstitial is wrong, per research I posted later.  Both Google and Yahoo (as of this writing) use interstitial ping pages which change their ostensibly secure search to only partially secure.  Other search engines like Bing maintain better security from end to end.  Please read my later comments here for the bigger picture.

2 replies

May 21, 2015

Hi @Ravi Ansal

Thanks for posting a question! However, this is the champion group where we hope you'll come to learn about the Champion program and ask questions about it if you have them. Your question is more appropriate for our Products and Support​ area, where all Marketo 'how to' questions should go. Please move your post so it can be answered faster by clicking "move" on the right side of this discussion.


Thanks!

Joe_Reitz
Level 8
May 21, 2015

Hi Ravi,

We track how a lead found their way to our content by using different links, like www.domain.com/content?ref=QueryString

So the link we send through email: www.domain.com/content?ref=email

vs. LinkedIn: www.domain.com/content?ref=LinkedIn

vs. our website: www.domain.com/content?ref=website

Then these leads are automatically added to a smartlist within the program. Is this what you mean?

We

If it doesn't look cool, you're probably doing it wrong.
SanfordWhiteman
Level 10
May 21, 2015

I assumed Ravi was talking about the referring page, which can be different even if the destination URL on your site is the same (although, as you illustrate, in many cases you can embed the friendly name of the source directly into the destination URL when placing an advertising link).

@Ravi Ansal​ Marketo (both Munchkin and Forms) will always try to store the referrer if it's present.  However, there are some cases where it cannot be provided.  One major example is if the referring site is using but your LP is using plain .  In this case browsers are protecting your privacy by suppressing the information, thus it will be blank.  There is nothing you can do, even with JavaScript, to retrieve it.

Elliott_Lowe1
Level 7
May 21, 2015

Sanford, are you saying that when someone is referred to a munchkin tracked web page that uses HTTPS from a Google search where they are logged in to Google (URL's scheme is ), that the Referrer URL will be captured?