There is an extra set of script tags getting spit out currently. There is no longer the need to wrap the GA code within script tag markup. The drupal_pre_render_scripts function now handles this.
Current:
<script>
<!--//--><![CDATA[//><!--
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
//--><!]]>
</script>
Expected:
<script type="text/javascript">
<!--//--><![CDATA[//><!--
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
//--><!]]>
</script>
drupal_pre_render_scripts()
http://api.drupal.org/api/drupal/core!includes!common.inc/function/drupa...
Comments
Comment #1
desmondmorris commentedHere is the patch. I also added the attributes option to the drupal_add_js function call to include the type attribute to the script tag. Though, it looks like the attributes option is not quite working as expected (http://drupal.org/node/1664602)
Comment #2
desmondmorris commentedArgh, I always forget the attachement
Comment #3
frobcommited
Comment #4.0
(not verified) commentedspacing