Statcounter in head tag

I'm redirecting traffic which comes to my website from anywhere outside of the US and Canada to the manufacturer's website in europe.

I'm using a web service IP lookup for a country code and javascript in the head of the page to redirect the visitor based on country. Having the redirect javascript as close to the top of the head tag reduces redirect latency to the european website.

I would like to use Statcounter to document the visitors I am sending to the manufacturer's site. I must place the Statcounter code before the redirect script in the head tag.

I did some tests in the head tag where I removed noscript code and added a setTimeout between Statcounter's javascript and my redirect ("window.location ="). If I remember correctly, I had limited success.

Does a method for doing this already exist?



Staff member

If there is a few seconds of delay in the JS redirect our full code between the <body></body> tags should log the hit ok.