Get referral URL in javascript

I want to see how much traffic I get from various URL reduction services, for example

bit.ly

tinyurl.com

But since they use 301 redirects, they do not appear in my analytics.

How to find out who redirects traffic?

Or

More precisely, how can I get the referral url in javascript for another kind of redirect?

+3
source share
1 answer

document.referrer

Example:

 if (document.referrer && document.referrer != "") document.write('Thanks for visiting this site from ' + document.referrer); 
+3
source share

All Articles