Last active
May 1, 2024 11:34
-
-
Save stengland/e3a88bc619fea3432b30ec5d2884f62c to your computer and use it in GitHub Desktop.
Easy redirects or geo data using https://freegeoip.net, can be used on google tag manager.
This file contains 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
<script> | |
function geo(data) { | |
if (data.country_code == 'IE') { | |
window.location = "/ie" + window.location.search; | |
} else { | |
dataLayer.push(data); | |
} | |
} | |
</script> | |
<script src="https://freegeoip.net/json/?callback=geo"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment