Skip to content

Instantly share code, notes, and snippets.

@chipoglesby
Created July 20, 2015 15:54
Show Gist options
  • Select an option

  • Save chipoglesby/5a76ab3e4b0af0458274 to your computer and use it in GitHub Desktop.

Select an option

Save chipoglesby/5a76ab3e4b0af0458274 to your computer and use it in GitHub Desktop.
Blocking internal traffic in Google Tag Manager
<script>
function ipAddresses() {
var newIP = '{{visitorIP}}';
var patt = new RegExp("^28.28.128.1[0-9]?$");
if(patt.test(newIP) === true) {return('internal');}
var patt = new RegExp("^65.65.65.12[0-9]?$");
if(patt.test(newIP) === true) {return('monitoring');}
return('external');
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment