Analytics reporting UK visitors as US

Site info:

Hi there,

I just installed Plausible Analytics but by UK visitors are being reported as coming from the US.

I asked their support what is going on, and they responded with this:

If you’re using Cloudflare for DNS, chances are you are having your sites proxied behind Cloudflare too. A proxy can override the remote IP which would lead to wrong geolocation data in your stats. Please remove the proxy and make it just a DNS record in your Cloudflare settings to solve the issue.

TBH I don’t understand DNS (like I understand JavaScript, for example) so I’m not sure I will be able to succinctly provide the right info, but AFAIK my host’s A record is pointing at netlify in the USA.

Do I need to speak to them or solve things here?

Thanks,
Dave

Hi, @davestewart. Our DNS instructions for all third-party DNS service (and DNS service besides Netlify DNS) are found here:

For your domain, the DNS records should look like this:

davestewart.co.uk.   	21600	IN	A    	104.198.14.52
www.davestewart.co.uk.	21600	IN	CNAME	davestewart.netlify.app.

However, instead they look like this:

davestewart.co.uk.  	21600	IN	A	76.76.21.21
www.davestewart.co.uk.	21600	IN	A	104.198.14.52

So, step #1, you will need to correct the DNS records above.

We are not done though. There are two additional steps required to fix this.

Step #2, make the www subdomain the “primary custom domain” here:

https://app.netlify.com/sites/davestewart/settings/domain#custom-domains

Right now, the apex domain (davestewart.co.uk) is primary. However, this is using the A record and the A record is a single system in California. If you make this domain primary then all site traffic for anyone in the world will go only to California. Obviously, this is not what you want.

Making the www subdomain primary will use the CNAME record. and that CNAME using geographical routing to return IP addresses of the closest ADN nodes. You can see the geographical routing of IP address if you query the site subdomain from different locations around the world, for example - by using this DNS checking tool:

https://dnschecker.org/#A/davestewart.netlify.app

This shows the CNAME returning many different IP addresses around the world (not just 104.198.14.52). Now, let’s check your current A record:

https://dnschecker.org/#A/www.davestewart.co.uk

It is sending all global traffic to one IP address in California. The wrong DNS is the root cause.

Again, making the www primary (and fixing the DNS record is step one) will fix this.

Step #3, is to delete the inactive Netlify DNS zone here:

Click the “Delete DNS zone” button on that page. There is a support guide to explain why here.

Do not skip step #3. If you skip this step, the SSL certificate will stop working when it expires because renewals will fail.

To summarize the steps for the solution, they are:

  1. Correct the existing DNS records.
  2. Make the www subdomain the primary custom domain for the site at Netlify.
  3. Delete the inactive Netlify DNS zone.

If there are any questions about this, please let us know.

Hi Luke,

Amazing reply, thank you!

Will look to action that, and bookmarking this for future reference.

:smiley: