This is actually a question for Joost. HTML minification probably needs to be completely disabled to leave the markup untouched. If you’re trying to minify the google code embed, remove that from your JS minify settings.
Thread Starter
Zemalf
(@zemalf)
You are right. I think taking HTML minification helped on this.
The probably cause was the // comment on the code the Google Analytics for WordPress puts out. And when that is on single line it messes it up (or at least that caught my attention when I checked it).
What do you think, can the HTML minification etc. be on if using “manually” inserted Analytics code?
Definitely, check out my site as an example.
I’ve been getting an intermittent error to do with this on one of my blogs:
W3 Total Cache Error: Minify error: Unterminated String: "UA-146872-2
This results in a blank page with the error on it until I empty the caches. It hasn’t happened on any other one so far. I am using 2.9 and Joost’s latest. Unfortunately, the error was caught by Googlebot, so it’s currently enshrined at
Again, it’s the obligation of plugin authors to ensure their plugins can work with minification. The FAQ suggests not minifying any statistics related scripts or code and again I’m encouraging you to disable HTML minification. Also the first link shows you running hypercache and not W3TC, the second shows the minification issue that Zemalf raised.
Hi Fred,
I was running hypercache, but deleted it when I switched to W3 Totalcache. Unfortunately the Google cache appears to have changed, and the first link doesn’t produce an error now. In fact, for the same search this thread comes up first!
I haven’t had any problems since, but I’ve disable HTML minification in W3 TC as you recommended.
I’m waiting for the 2.91 upgrade before rolling out the rest of the blog changes, but I have to say that W3 TC seems to be doing a great job speeding up my sites where implemented up to now. Looks like becoming the gold standard.
Tony
So quick question about this… I typically hard code the GA code into the footer of my theme. Will any settings using the W3TC plugin have a negative effect on my GA readings if I manually install the code in the footer?