13 Replies Latest reply on May 22, 2015 11:59 AM by Sanford Whiteman

    Need to Track the reference URL ?

    Ravi Ansal

      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

        • Re: Need to Track the reference URL ?

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


          • Re: Need to Track the reference URL ?
            Joe Reitz

            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 Marketo___2014_VAWA_White_Paper_source___LinkedIn_•_Marketing_Activities.png

            1 of 1 people found this helpful
              • Re: Need to Track the reference URL ?
                Sanford Whiteman

                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 https:// but your LP is using plain http://.  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.

                  • Re: Need to Track the reference URL ?
                    Elliott Lowe

                    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 https://), that the Referrer URL will be captured?

                      • Re: Need to Track the reference URL ?
                        Sanford Whiteman

                        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.

                        1 of 1 people found this helpful
                          • Re: Need to Track the reference URL ?
                            Elliott Lowe

                            It seems as though the Referrer URL is tracked even when referred from HTTPS to HTTP.  While logged in to Google, I clicked an organic link to http://www.integrativenutrition.com and my Marketo lead record shows the Referrer URL as http://www.google.com/ 

                              • Re: Need to Track the reference URL ?
                                Sanford Whiteman

                                If the referer URL is http://www.google.com then you weren't using secure search -- simple as that.  Note Google does not always redirect you to their secure site.  The http:// search site still exists, for example this is a direct link to insecure search.


                                ETA: To go back and correct myself here, Elliott Lowe was indeed using "secure search" in his test -- as in going to https://www.google.com to begin with -- but both Google and Yahoo (see my long-winded post below after I did some up-to-date tests) bounce users off a plain http:// link before going to the final destination. So, in a sense, with those search engines there is no such thing as end-to-end security.  You really have a mixed-content environment considering the extra hops; it's not as simple as one company's https://www.example.com having an <A> to another company's http://www.example2.com.


                                With https://www.bing.com, on the other hand, you never hit an http:// site along the way, so Bing (and, I found later, Startpage Search Engine and the venerable Dogpile Web Search) would conform more strictly to the notion of "secure search." 


                                So what is the practical difference?  OK, imagine you have a hacker listening on all your network traffic (as we are supposed to assume is happening whenever we're at a hotel or coffee bar).


                                • If you use "secure Bing" and go to another https:// site, then the hacker will only know you went to bing.com and example.com.  They won't see the URL paths or cookies or any other information you sent to these sites.
                                • If you use "secure Yahoo" and go to another https:// site, the hacker can see [a] the full path you are going to on the https:// site and [b] any cookies that are sent to http://r.search.yahoo.com


                                That's actually a pretty big difference when you ruminate on it.

                                1 of 1 people found this helpful
                                • Re: Need to Track the reference URL ?
                                  Sanford Whiteman

                                  Hey Elliott/Ravi, I just did a couple of quick tests to confirm HTTPS to HTTP differences across browsers and search engines.  As I remembered, the Referrer is not reliably delivered, which causes confusion.


                                  I tested Bing (https://www.bing.com), Yahoo (https://search.yahoo.com), and Google (https://www.google.com) in Chrome 43, Firefox 34, and IE 8 on Windows (not meant to be an exhaustive test but the diffs are already apparent).



                                  • no Referrer in Chrome, FF, or IE
                                  • Bing sends user directly to the destination page, performing "ping" functions asynchronously



                                  • Referrer available in Chrome, FF, IE
                                  • Referrer is same format in all browsers
                                  • Referrer shown is a seemingly "full" URL from http://r.search.yahoo.com/_ylt=...;_ylu=... but does not reveal search terms, only opaque search information plus the destination URL
                                  • Yahoo bounces user off interstitial "ping" page r.search.yahoo.com, and this page is plain http://.  A JS redirect is used. Thus the http:// URL can be sent as a referrer, but the URL was already crafted to strip user-entered info



                                  • Referrer available in Chrome, FF, IE
                                  • Referrer is different in Chrome vs. FF/IE
                                  • In Chrome, only https://www.google.com is shown (path/query/hash is truncated)
                                  • In FF/IE the "full" URL from http://www.google.com/url?... is shown.  But as with Yahoo this URL is sanitized, not revealing user-entered information
                                  • Chrome bounces user off interstitial "ping" page www.google.com, plain http://, using JS redirect.  Chrome and FF/IE treat the redirect mechanism with different rules.  Chrome only forwards the top-level domain from the original page, while FF/IE forward the full URL from the interstitial page.


                                  We should remember -- and Ravi, I'll get to your most recent question in a moment, as I just saw that post come in -- that "secure search" has a a few closely connected but different purposes.  One is to allow people to not have their search terms snooped by somebody listening on the wire (a fourth party unaffiliated with the search engine, the user, nor any destination site) just as https:// protects sensitive e-commerce traffic.  Another purpose is to allow the user to respect the "intention" of privacy that they get from browsing securely by not forwarding the wire-secured traffic to a site that isn't also secure.  And another purpose is to continue that privacy all the way to the destination site, even if that is site is secure on the wire, by not letting them know what else you might have entered in the search box.

                                  2 of 2 people found this helpful