outputting bad code?
-
I haven’t had any problems installing this plugin on quite a few sites. Maybe there’s just something weird about this instance. I looked at view-source and here is what the output looks like:
'<script type="text/javascript">//<![CDATA[
// Google Analytics for WordPress by Yoast v4.1 | https://yoast.com/wordpress/google-analytics/
var _gaq = _gaq || [];
_gaq.push(['_setAccount','UA-17233107-11']);
_gaq.push(['_trackPageview'],['_trackPageLoadTime']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'https://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
//]]></script>'Note the funny slashes and brackets right before the closing script tag. After inserting the GA code (copying from Google, not the plugin output) manually into my theme files everything worked fine and the tracking code was verified. (PS – using custom child theme built on the Hybrid Theme, not sure if that is relevant)
- The topic ‘outputting bad code?’ is closed to new replies.