Hi everyone.
I wanted to see if you could help me out with a redirect issue I’m experiencing.
I’m currently managing a WordPress site which has a page with a newsletter form on it.
I have to redirect people based on their IP address and have come up with this solution using Fetch and IPInfo API.
`fetch(‘https://ipinfo.io/json?token=tokenGoesHere’).then((response)=>{`
`return response.json();`
`}).then((response)=>{`
`if(response[‘country’] === ‘US’){`
`window.location=’https://usapage.com’;`
`}`
`});`
I’ve tested it and have had other people test it with a US IP address and it seems to be working fine.
The only issue is, about once a month or so, I’m getting sign ups from people within the US, which I should not be getting, because they should be getting redirected to the USA page (which I do not manage).
I have checked their IP addresses and they are indeed from the US (so they’re not using VPNs).
What could be the issue here?
Thanks in advance!
[ad_2]