Created
July 20, 2015 15:54
-
-
Save chipoglesby/5a76ab3e4b0af0458274 to your computer and use it in GitHub Desktop.
Blocking internal traffic in Google Tag Manager
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
| <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