Skip to content

Instantly share code, notes, and snippets.

@dtran320
Created July 26, 2011 05:45
Show Gist options
  • Save dtran320/1106059 to your computer and use it in GitHub Desktop.
Save dtran320/1106059 to your computer and use it in GitHub Desktop.
Extract referrer domain name in javascript
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