Last active
July 9, 2021 21:48
-
-
Save parhumm/9f096a889fb27bbb35d1e149f6d5a1ec to your computer and use it in GitHub Desktop.
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() { | |
var virtualPagePath = ''; | |
try { | |
// Add subdomain before page path | |
var locationSplitDot = window.location.host.split('.'); | |
if (locationSplitDot && locationSplitDot[1]) { | |
if (locationSplitDot[0] !== 'www') { | |
virtualPagePath = location.host; | |
} | |
} | |
} catch(e) { | |
console.error(e) | |
} | |
// Add current page path | |
virtualPagePath += location.pathname; | |
return virtualPagePath; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment