Created
July 26, 2011 05:45
-
-
Save dtran320/1106059 to your computer and use it in GitHub Desktop.
Extract referrer domain name in javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getReferrerDomain() { | |
var url = document.createElement('a'); | |
url.href = document.referrer; | |
return url.hostname; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment