Saturday, April 29, 2017

Google Analytics not getting hits despite the script being there? Check the encoding

A while back, I tinkered with Google Analytics for one of my web sites. I put the JavaScript fragment they gave me into the right place in the HTML, but no matter how I finagled it, Google said the property was missing its tracking code.

More recently, I had a similarly bizarre problem with reCaptcha. Eventually I figured out that the encoding of the HTML file was UTF-16LE, but changing it to UTF-8 made reCaptcha load. I checked today and Google Analytics is now working on that site as well. The encoding issue somehow caused the load of all external scripts to fail.

No comments:

Post a Comment