Search code examples
javascriptreferrer

How to get original referrer url when invoking javascript??


Let us take i am in site named domain1.com and navigating to another site domain2.com, where i invoke a external js call.

The problem is the referrer of the js call is domain2.com and but i need the original referrer i.e. domain1.com. I see that the google analytics request, i see that the query parameter utmr hold the referrer url. example - utmr

Any idea how to get the same as that in GA ?


Solution

  • I got the solution, it is simple. The document.referrer added in external script works fine and provide the referrer URL of the current page.

    Thank you Balaji