Anonymization of IP adresses with Google Tag Manager

Danny Mawani Olsen
Danny Mawani OlsenDigital analytics consultant at IMPACT EXTEND A/S
COPENHAGEN MEASURECAMP
2018
ANONYMIZATION OF IP
ADRESSESES WHILE STILL
EXCLUDING INTERNAL
TRAFFIC
June, 2018
• Lead analyst at IMPACT EXTEND
• Lives in this city
• 6th measurecamp
Who am i?
THE WAY WE ARE
CURRENTLY
EXPERIMENTING WITH IT
User
enters the
site
If the user is internal
Set cookie isInternal
Check for cookie in GTM
Use lookup table to set
anonymize IP to nothing
If the user is external
Set cookie isExternal
Check for cookie in GTM
Anonymize IP
Script
checks if
IP is
internal or
external
How it works
Why should you care?
YOU SHOULD CARE IF
YOU WANT TO EXCLUDE
INTERNAL TRAFFIC
HOW IT
WORKS
• First pageview will always be anonymized as no
cookie is set
• Script is fired to check the users IP with a regex
• To find what IP adresses that should be excluded
you need to grab them from your current Google
Analytics settings
1. USER VISITS THE SITE AND
GETS A COOKIE var client = new HttpClient();
client.get('https://api.ipify.or
g?format=json', function(response) {
var result =
JSON.parse(response);
var ip = result.ip;
var ipInternal =
/^((94.231.106.19)|(217.195.188
.30)|(94.231.104.(1[6-9]|2[0-
9]|3[0-1]))|(93.176.86.(19[2-
9]|2[0-5][0-9]))|(94.231.99.(1[6-
8][0-9]|19[0-
1]))|(80.198.126.162)|(192.168.
126.162)|(93.176.86.194)|(93.17
6.86.209)|(50.23.94.74)|(46.20
.45.18)|(94.46.4.1)|(108.62.1
15.226)|(69.64.56.47)|(46.165.
195.139)|(94.247.174.83)|(199.8
7.228.66)|(76.72.167.90)|(184.
75.210.186)|(93.176.86.252)|(94
.231.99.)|(3[2-9]|[4-5][0-9]|6[0-
3])|(5.56.154.58)|(212.237.134
.78)|(93.176.86.149)|(93.176.86
.149))$/i;
1. USER VISITS THE SITE AND
GETS A COOKIE
1. USER VISITS THE SITE AND
GETS A COOKIE
If IP matches an internal one – set
the cookie as internal - Else do
the opposite
2. GRAB THE COOKIES YOU JUST
SET
2. GRAB THE COOKIES YOU JUST
SET
• Make sure that the you choose an appropriate
time period to save the cookie in the browser
• Set a triggerrule on pages to not fire the script if
the cookie is already set – the developers will
love you for it
• The developers will probably not love you for it,
they will probably be annoyed that you are
adding code on their website
• I will also present a version where the
developers do all the technical stuff for you – no
worries!
3. MAKE SURE IT DOESN’T
FIRE ALL THE TIME!
4. WRITE A SCRIPT TO RETURN IF THE
USER IS INTERNAL
function () {
var returnValue = "true";
var external = {{cookie - External traffic}};
var internal = {{cookie - internal traffic}};
if(external == 1) {
returnValue = "true";
}
else if (internal == 1) {
returnValue = "false";
}
else {
returnValue = "true";
}
return returnValue;
}
• The script checks the cookie and finds out
weather the user is internal or external.
• We are using this to create a boolean value to
which we can send the value through a custom
dimension (not needed though)
5. USE IT IN A CUSTOM DIMENSION IF YOU NEED TO
EXCLUDE TRAFFIC WITH THAT!
6. IF YOU ARE EVEN MORE LAZY, ANONYMIZE IP
ADRESSES WHEN IT HITS GA,AND PREVENT
CHANGING YOUR CURRENT SETTINGS !
WHERE
DOES
THIS
LEAVE
US?
1. Exclude IP adress
through your current
GTM Filters
• Quite nice, as you can
just keep your current
settings
• It does however provide
a threat as you are not
anonymizing all IP
traffic, and it is possible
something you have to
talk about with your
vendors and
consultants.
2. Exclude based on the
custom dimension
• Data is already avaliable
from the custom
dimension, so dividing
internal and external is
easy
• It does however take a
bit longer than the first
solution
3. You could also make
your developers do it
• If you have a list of IP
adresses that should be
included, you can make
your IT department
expost them as a
boolean ”internal or
external” value in the
datalayer
• You do however have to
fight with the IT guys to
make it happen
THIS LEAVES US WITH A LOT OF
OPPORTUNITIES!
WHAT DO YOU GUYS
THINK ABOUT THE
SOLUTION?
Anonymization of IP adresses with Google Tag Manager
1 of 20

Recommended

Eradicate Flaky Tests - AppiumConf 2021 by
Eradicate Flaky Tests - AppiumConf 2021Eradicate Flaky Tests - AppiumConf 2021
Eradicate Flaky Tests - AppiumConf 2021Anand Bagmar
241 views67 slides
Experimentation as a growth strategy at Booking.com by
Experimentation as a growth strategy at Booking.comExperimentation as a growth strategy at Booking.com
Experimentation as a growth strategy at Booking.comwebwinkelvakdag
599 views57 slides
Eradicate Flaky Tests by
Eradicate Flaky TestsEradicate Flaky Tests
Eradicate Flaky TestsAnand Bagmar
419 views66 slides
How to kill test flake in appium by
How to kill test flake in appiumHow to kill test flake in appium
How to kill test flake in appiumGaurav Singh
2.3K views38 slides
Hogy néz ki egy pentest meló a gyakorlatban? by
Hogy néz ki egy pentest meló a gyakorlatban?Hogy néz ki egy pentest meló a gyakorlatban?
Hogy néz ki egy pentest meló a gyakorlatban?hackersuli
70 views26 slides
InMobi indecode - How Did We Build Our App at Freecharge by
InMobi indecode - How Did We Build Our App at FreechargeInMobi indecode - How Did We Build Our App at Freecharge
InMobi indecode - How Did We Build Our App at FreechargeInMobi
875 views14 slides

More Related Content

Similar to Anonymization of IP adresses with Google Tag Manager

The Economic Benefits of the Postman API Platform by
The Economic Benefits of the Postman API PlatformThe Economic Benefits of the Postman API Platform
The Economic Benefits of the Postman API PlatformPostman
90 views46 slides
API Testing with Frisby and Mocha by
API Testing with Frisby and MochaAPI Testing with Frisby and Mocha
API Testing with Frisby and MochaLyudmila Anisimova
778 views34 slides
SplunkLive! Paris 2018: Intro to Security Analytics Methods by
SplunkLive! Paris 2018: Intro to Security Analytics MethodsSplunkLive! Paris 2018: Intro to Security Analytics Methods
SplunkLive! Paris 2018: Intro to Security Analytics MethodsSplunk
252 views45 slides
代码大全(内训) by
代码大全(内训)代码大全(内训)
代码大全(内训)Horky Chen
1.3K views87 slides
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W... by
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...OutSystems
353 views26 slides
It Worked for Ustream by
It Worked for UstreamIt Worked for Ustream
It Worked for UstreamBalázs Kereskényi
676 views25 slides

Similar to Anonymization of IP adresses with Google Tag Manager(20)

The Economic Benefits of the Postman API Platform by Postman
The Economic Benefits of the Postman API PlatformThe Economic Benefits of the Postman API Platform
The Economic Benefits of the Postman API Platform
Postman90 views
SplunkLive! Paris 2018: Intro to Security Analytics Methods by Splunk
SplunkLive! Paris 2018: Intro to Security Analytics MethodsSplunkLive! Paris 2018: Intro to Security Analytics Methods
SplunkLive! Paris 2018: Intro to Security Analytics Methods
Splunk252 views
代码大全(内训) by Horky Chen
代码大全(内训)代码大全(内训)
代码大全(内训)
Horky Chen1.3K views
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W... by OutSystems
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
OutSystems353 views
LITE 2018 – A Deep Dive Into the API [Iain Brown] by getadministrate
LITE 2018 – A Deep Dive Into the API [Iain Brown]LITE 2018 – A Deep Dive Into the API [Iain Brown]
LITE 2018 – A Deep Dive Into the API [Iain Brown]
getadministrate123 views
Got pain? Marketo + Workato by Kelly Trantow
Got pain? Marketo + WorkatoGot pain? Marketo + Workato
Got pain? Marketo + Workato
Kelly Trantow351 views
How to Perform Churn Analysis for your Mobile Application? by Tatvic Analytics
How to Perform Churn Analysis for your Mobile Application?How to Perform Churn Analysis for your Mobile Application?
How to Perform Churn Analysis for your Mobile Application?
Tatvic Analytics2.5K views
Ideas to Execution: (Mis)using Code for Prototypes by Intuit Inc.
Ideas to Execution: (Mis)using Code for PrototypesIdeas to Execution: (Mis)using Code for Prototypes
Ideas to Execution: (Mis)using Code for Prototypes
Intuit Inc.1.2K views
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg... by Gáspár Nagy
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...
Gáspár Nagy708 views
Google Optimize for testing and personalization by OWOX BI
Google Optimize for testing and personalizationGoogle Optimize for testing and personalization
Google Optimize for testing and personalization
OWOX BI1.3K views
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond... by Gáspár Nagy
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Gáspár Nagy443 views
ONBOARDING AT SCALE AT BOOKING.COM by Savage Marketing
ONBOARDING AT SCALE AT BOOKING.COMONBOARDING AT SCALE AT BOOKING.COM
ONBOARDING AT SCALE AT BOOKING.COM
Savage Marketing1.5K views
Integrating Icinga 2 and ntopng - Icinga Camp Milan 2019 by Icinga
Integrating Icinga 2 and ntopng - Icinga Camp Milan 2019Integrating Icinga 2 and ntopng - Icinga Camp Milan 2019
Integrating Icinga 2 and ntopng - Icinga Camp Milan 2019
Icinga847 views
Surviving the AB Testing Hype Cycle - Reaktor Breakpoint 2015 by Craig Sullivan
Surviving the AB Testing Hype Cycle - Reaktor Breakpoint 2015Surviving the AB Testing Hype Cycle - Reaktor Breakpoint 2015
Surviving the AB Testing Hype Cycle - Reaktor Breakpoint 2015
Craig Sullivan2.8K views
How to Pass the Google Analytics Individual Qualification Test by Slingshot SEO by Aarif Nazir
How to Pass the  Google Analytics Individual Qualification Test by Slingshot SEOHow to Pass the  Google Analytics Individual Qualification Test by Slingshot SEO
How to Pass the Google Analytics Individual Qualification Test by Slingshot SEO
Aarif Nazir2.6K views
AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC... by Amazon Web Services
AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...
AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...
Cross Device Optimisation - Google Analytics Shortcuts by Craig Sullivan
Cross Device Optimisation - Google Analytics ShortcutsCross Device Optimisation - Google Analytics Shortcuts
Cross Device Optimisation - Google Analytics Shortcuts
Craig Sullivan3.7K views
Flipkart Data Platform @ Scale - slash n 2018 reprise by FlipkartStories
Flipkart Data Platform @ Scale - slash n 2018 repriseFlipkart Data Platform @ Scale - slash n 2018 reprise
Flipkart Data Platform @ Scale - slash n 2018 reprise
FlipkartStories1.5K views

Recently uploaded

CRM stick or twist.pptx by
CRM stick or twist.pptxCRM stick or twist.pptx
CRM stick or twist.pptxinfo828217
11 views16 slides
Product Research sample.pdf by
Product Research sample.pdfProduct Research sample.pdf
Product Research sample.pdfAllenSingson
29 views29 slides
VoxelNet by
VoxelNetVoxelNet
VoxelNettaeseon ryu
16 views21 slides
Cross-network in Google Analytics 4.pdf by
Cross-network in Google Analytics 4.pdfCross-network in Google Analytics 4.pdf
Cross-network in Google Analytics 4.pdfGA4 Tutorials
6 views7 slides
AvizoImageSegmentation.pptx by
AvizoImageSegmentation.pptxAvizoImageSegmentation.pptx
AvizoImageSegmentation.pptxnathanielbutterworth1
6 views14 slides
Amy slides.pdf by
Amy slides.pdfAmy slides.pdf
Amy slides.pdfStatsCommunications
5 views13 slides

Recently uploaded(20)

CRM stick or twist.pptx by info828217
CRM stick or twist.pptxCRM stick or twist.pptx
CRM stick or twist.pptx
info82821711 views
Product Research sample.pdf by AllenSingson
Product Research sample.pdfProduct Research sample.pdf
Product Research sample.pdf
AllenSingson29 views
Cross-network in Google Analytics 4.pdf by GA4 Tutorials
Cross-network in Google Analytics 4.pdfCross-network in Google Analytics 4.pdf
Cross-network in Google Analytics 4.pdf
GA4 Tutorials6 views
OPPOTUS - Malaysians on Malaysia 3Q2023.pdf by Oppotus
OPPOTUS - Malaysians on Malaysia 3Q2023.pdfOPPOTUS - Malaysians on Malaysia 3Q2023.pdf
OPPOTUS - Malaysians on Malaysia 3Q2023.pdf
Oppotus23 views
[DSC Europe 23][AI:CSI] Aleksa Stojanovic - Applying AI for Threat Detection ... by DataScienceConferenc1
[DSC Europe 23][AI:CSI] Aleksa Stojanovic - Applying AI for Threat Detection ...[DSC Europe 23][AI:CSI] Aleksa Stojanovic - Applying AI for Threat Detection ...
[DSC Europe 23][AI:CSI] Aleksa Stojanovic - Applying AI for Threat Detection ...
[DSC Europe 23] Rania Wazir - Opening up the box: the complexity of human int... by DataScienceConferenc1
[DSC Europe 23] Rania Wazir - Opening up the box: the complexity of human int...[DSC Europe 23] Rania Wazir - Opening up the box: the complexity of human int...
[DSC Europe 23] Rania Wazir - Opening up the box: the complexity of human int...
[DSC Europe 23] Ales Gros - Quantum and Today s security with Quantum.pdf by DataScienceConferenc1
[DSC Europe 23] Ales Gros - Quantum and Today s security with Quantum.pdf[DSC Europe 23] Ales Gros - Quantum and Today s security with Quantum.pdf
[DSC Europe 23] Ales Gros - Quantum and Today s security with Quantum.pdf
4_4_WP_4_06_ND_Model.pptx by d6fmc6kwd4
4_4_WP_4_06_ND_Model.pptx4_4_WP_4_06_ND_Model.pptx
4_4_WP_4_06_ND_Model.pptx
d6fmc6kwd47 views
[DSC Europe 23][Cryptica] Martin_Summer_Digital_central_bank_money_Ideas_init... by DataScienceConferenc1
[DSC Europe 23][Cryptica] Martin_Summer_Digital_central_bank_money_Ideas_init...[DSC Europe 23][Cryptica] Martin_Summer_Digital_central_bank_money_Ideas_init...
[DSC Europe 23][Cryptica] Martin_Summer_Digital_central_bank_money_Ideas_init...
Short Story Assignment by Kelly Nguyen by kellynguyen01
Short Story Assignment by Kelly NguyenShort Story Assignment by Kelly Nguyen
Short Story Assignment by Kelly Nguyen
kellynguyen0119 views
Dr. Ousmane Badiane-2023 ReSAKSS Conference by AKADEMIYA2063
Dr. Ousmane Badiane-2023 ReSAKSS ConferenceDr. Ousmane Badiane-2023 ReSAKSS Conference
Dr. Ousmane Badiane-2023 ReSAKSS Conference
AKADEMIYA20635 views
[DSC Europe 23] Zsolt Feleki - Machine Translation should we trust it.pptx by DataScienceConferenc1
[DSC Europe 23] Zsolt Feleki - Machine Translation should we trust it.pptx[DSC Europe 23] Zsolt Feleki - Machine Translation should we trust it.pptx
[DSC Europe 23] Zsolt Feleki - Machine Translation should we trust it.pptx
Ukraine Infographic_22NOV2023_v2.pdf by AnastosiyaGurin
Ukraine Infographic_22NOV2023_v2.pdfUkraine Infographic_22NOV2023_v2.pdf
Ukraine Infographic_22NOV2023_v2.pdf
AnastosiyaGurin1.4K views
PRIVACY AWRE PERSONAL DATA STORAGE by antony420421
PRIVACY AWRE PERSONAL DATA STORAGEPRIVACY AWRE PERSONAL DATA STORAGE
PRIVACY AWRE PERSONAL DATA STORAGE
antony4204217 views
CRM stick or twist workshop by info828217
CRM stick or twist workshopCRM stick or twist workshop
CRM stick or twist workshop
info82821712 views

Anonymization of IP adresses with Google Tag Manager

  • 1. COPENHAGEN MEASURECAMP 2018 ANONYMIZATION OF IP ADRESSESES WHILE STILL EXCLUDING INTERNAL TRAFFIC June, 2018
  • 2. • Lead analyst at IMPACT EXTEND • Lives in this city • 6th measurecamp Who am i?
  • 3. THE WAY WE ARE CURRENTLY EXPERIMENTING WITH IT
  • 4. User enters the site If the user is internal Set cookie isInternal Check for cookie in GTM Use lookup table to set anonymize IP to nothing If the user is external Set cookie isExternal Check for cookie in GTM Anonymize IP Script checks if IP is internal or external How it works
  • 6. YOU SHOULD CARE IF YOU WANT TO EXCLUDE INTERNAL TRAFFIC
  • 8. • First pageview will always be anonymized as no cookie is set • Script is fired to check the users IP with a regex • To find what IP adresses that should be excluded you need to grab them from your current Google Analytics settings 1. USER VISITS THE SITE AND GETS A COOKIE var client = new HttpClient(); client.get('https://api.ipify.or g?format=json', function(response) { var result = JSON.parse(response); var ip = result.ip; var ipInternal = /^((94.231.106.19)|(217.195.188 .30)|(94.231.104.(1[6-9]|2[0- 9]|3[0-1]))|(93.176.86.(19[2- 9]|2[0-5][0-9]))|(94.231.99.(1[6- 8][0-9]|19[0- 1]))|(80.198.126.162)|(192.168. 126.162)|(93.176.86.194)|(93.17 6.86.209)|(50.23.94.74)|(46.20 .45.18)|(94.46.4.1)|(108.62.1 15.226)|(69.64.56.47)|(46.165. 195.139)|(94.247.174.83)|(199.8 7.228.66)|(76.72.167.90)|(184. 75.210.186)|(93.176.86.252)|(94 .231.99.)|(3[2-9]|[4-5][0-9]|6[0- 3])|(5.56.154.58)|(212.237.134 .78)|(93.176.86.149)|(93.176.86 .149))$/i;
  • 9. 1. USER VISITS THE SITE AND GETS A COOKIE
  • 10. 1. USER VISITS THE SITE AND GETS A COOKIE If IP matches an internal one – set the cookie as internal - Else do the opposite
  • 11. 2. GRAB THE COOKIES YOU JUST SET
  • 12. 2. GRAB THE COOKIES YOU JUST SET
  • 13. • Make sure that the you choose an appropriate time period to save the cookie in the browser • Set a triggerrule on pages to not fire the script if the cookie is already set – the developers will love you for it • The developers will probably not love you for it, they will probably be annoyed that you are adding code on their website • I will also present a version where the developers do all the technical stuff for you – no worries! 3. MAKE SURE IT DOESN’T FIRE ALL THE TIME!
  • 14. 4. WRITE A SCRIPT TO RETURN IF THE USER IS INTERNAL function () { var returnValue = "true"; var external = {{cookie - External traffic}}; var internal = {{cookie - internal traffic}}; if(external == 1) { returnValue = "true"; } else if (internal == 1) { returnValue = "false"; } else { returnValue = "true"; } return returnValue; } • The script checks the cookie and finds out weather the user is internal or external. • We are using this to create a boolean value to which we can send the value through a custom dimension (not needed though)
  • 15. 5. USE IT IN A CUSTOM DIMENSION IF YOU NEED TO EXCLUDE TRAFFIC WITH THAT!
  • 16. 6. IF YOU ARE EVEN MORE LAZY, ANONYMIZE IP ADRESSES WHEN IT HITS GA,AND PREVENT CHANGING YOUR CURRENT SETTINGS !
  • 18. 1. Exclude IP adress through your current GTM Filters • Quite nice, as you can just keep your current settings • It does however provide a threat as you are not anonymizing all IP traffic, and it is possible something you have to talk about with your vendors and consultants. 2. Exclude based on the custom dimension • Data is already avaliable from the custom dimension, so dividing internal and external is easy • It does however take a bit longer than the first solution 3. You could also make your developers do it • If you have a list of IP adresses that should be included, you can make your IT department expost them as a boolean ”internal or external” value in the datalayer • You do however have to fight with the IT guys to make it happen THIS LEAVES US WITH A LOT OF OPPORTUNITIES!
  • 19. WHAT DO YOU GUYS THINK ABOUT THE SOLUTION?