Hi, the quantcast code slotted in well and appears in every page, thanks for your efforts.

At the bottom of each page some characters appear that look like html escape code without the exclamation mark

//-->

in the code they appear right at the end of the body, after noscript and the quantcast gif

<noscript> <img src="http://pixel.quantserve.com/pixel/p-xxxxxxxxxxxxx.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/> </noscript>
//-->

Looking at the javascript in the webdeveloper toolbar I can see that the Jquery inline script is being intersected by the quant.js

Inline Script 

<!--//--><![CDATA[//><!--
<!-- Start Quantcast tag -->
<script type="text/javascript">
_qoptions={
qacct:"p-d5kgygRGsIH5E"
};

** Google analytics uses drupal_add_js($script, 'inline', 'footer');

Many thanks for any pointers or solutions

R3

Comments

rup3rt’s picture

I have solved my problem by placing the quantcast js in the Closure region (I use a canvas subtheme) with

drupal_add_js($script, 'inline', 'closure');

Placing it directly into the footer region didn't work.

R3

irakli’s picture

It seems like drupal_add_js() is not a good way of embedding this code, at all, since the code itself is HTML and the add_js() wraps it into <Script> tags considering it's just javascript.

I moved everything to hook_footer() and it should work much better now.

Thanks for reporting this.

irakli’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.