DEV Community

Discussion on: Why you should remove Google Analytics from your site

Collapse
 
mikenikles profile image
Mike

I'm curious to learn about the new vs returning metric as well.

Collapse
 
markosaric profile image
Marko Saric

Here's how it's counted:

Instead of setting a cookie with a unique user ID, we simply count the number of unique IP addresses that accessed your website to determine the visitor count.

To enhance the visitor privacy, we don’t actually store the raw visitor IP address in our database or logs. We run it through a one-way hash function to scramble the raw IP addresses and make them impossible to recover.

To further enhance visitor privacy, we add the website domain to their IP hash. This means that the same user will never have the same IP hash on two different websites. If we didn’t do this, the hash would effectively act like a third-party (cross-domain) cookie.

Network Address Translation allows many unique users to share the same public IP address. For this reason we also add the User-Agent string to the hash, although we don’t store the actual User-Agent string.

There's some more detail on what we collect and how we do it in our data policy.

Thread Thread
 
ngxson profile image
Xuan Son Nguyen • Edited

But what if their IP are changed? For example, they can change between different wifi/mobile networks. And on mobile network, some carriers actually assign a different IP if the user disconnect from mobile network for a long time.

Thread Thread
 
markosaric profile image
Marko Saric

If they change the IP they will be counted as another visitor. Similar as in if someone blocks/deletes their cookies, they become new visitors too. Not having to show a cookie banner is a worthwhile tradeoff for many sites though.