wellcometrust / reach

Wellcome tool to parse references scraped from policy documents using machine learning
MIT License
26 stars 4 forks source link

Creating IP Filters on Google analytics for seperate Internal Traffic and External Traffic views #538

Closed aoifespenge closed 4 years ago

aoifespenge commented 4 years ago

For our Google Analytics, we need to at least three different 'Views' on our Reach property: 1) All site data - no filtering required 2) External traffic only - need to filter out internal IP addresses 3) Internal traffic only - need to filter out non-internal IP addresses.

It involves being able to identify what our Wellcome IP addresses are. Sam can you help implement this?

Here is how Google says to do this: https://support.google.com/analytics/answer/1034840?hl=en

kristinenielsen commented 4 years ago

Just to recap, as there is only a static IP for the office, and as people are WFH these will be dynamic, so can't be filtered out consistently. The office IP should still be filtered out, and can be retrieved from other products analytics. So who has access to our analytics to make that change?

aoifespenge commented 4 years ago

Awaiting Sam to set up tracking code and IP filtering

SamDepardieu commented 4 years ago

Tracking code is setup and awaiting deployment (see #554 ). I don't have the permissions to create filters on GA, but if you can provide me with the permissions and the IPs to filter, I can do that pretty quickly.

aoifespenge commented 4 years ago

Ok yeah I needed to make you an admin. Done now!

aoifespenge commented 4 years ago

As discussed, I've created a 4th view on Reach GA account, for filtering out the Global Protect users, if it turns out that this is possible. If it possible, the IP filter can be added to that view

SamDepardieu commented 4 years ago

So after discussion with the infrastructure team, Global Protect's behaviour doesn't allow us to filter on some IPs.

SamDepardieu commented 4 years ago

After discussing the matter further with @aoifespenge , we decided to try this https://carloseo.com/exclude-dynamic-ip-google-analytics/

The way this works is by connecting to reach using the suffix ?internal to setup a cookie for the domain expiring a year later

SamDepardieu commented 4 years ago

Moving this to QA as we will need to test this out when deployed and make sure this way works.

dd207 commented 4 years ago

This can be closed now? @aoifespenge @SamDepardieu

SamDepardieu commented 4 years ago

Yup, it's working. Closing it