Statcounter in head tag

Discussion in 'Feature Request' started by garvincottle, Aug 11, 2014.

  1. garvincottle

    garvincottle New Member

    Joined:
    Aug 11, 2014
    Messages:
    1
    Likes Received:
    0
    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 = manufacturer.com"). If I remember correctly, I had limited success.

    Does a method for doing this already exist?

    Thanks!
     
  2. Rory_A

    Rory_A Administrator Staff Member

    Joined:
    Apr 30, 2008
    Messages:
    388
    Likes Received:
    0
    Hi,

    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.

    Regards,
    Rory
     
  3. zagros

    zagros New Member

    Joined:
    Feb 7, 2018
    Messages:
    1
    Likes Received:
    0
    I agree with your opinion, if you do this, it'll be fine
     

Share This Page