how do I put an asyncronous in the html: code of my pages

  • 1
  • Question
  • Updated 8 years ago
  • Answered
I am trying to use Quantcast to drive more visitors to my site but I don't know how to enter the asyncronous code into my html
Photo of zmhcustomdesign


  • 1 Post
  • 0 Reply Likes

Posted 8 years ago

  • 1
Photo of Gop


  • 7473 Posts
  • 2115 Reply Likes
Hi zmhcustomdesign,

If you can give us a link to the installation instructions we will have a look for you.
Photo of Justin Lavelle

Justin Lavelle

  • 8 Posts
  • 7 Reply Likes
Hi all

After some digging, I managed to find the instructions at Instructions with the following code:

<!-- Quantcast Tag -->
<script type="text/javascript">
var _qevents = _qevents || [];

(function() {
var elem = document.createElement('script');

elem.src = (document.location.protocol == "https:" ? "https://secure" : "http://edge") + "";
elem.async = true;
elem.type = "text/javascript";
var scpt = document.getElementsByTagName('script')[0];
scpt.parentNode.insertBefore(elem, scpt);
<script type="text/javascript">
_qevents.push( { qacct:"p-test123"} );
<div style="display: none;"><img src="//" height="1" width="1" alt="Quantcast"/></div>
<!-- End Quantcast tag -->

This needs to be inserted into your site's HTML before the closing body tag and can be done the following way:

1. Drop an HTML widget somewhere on your site (This can be found under BASIC)
2. When the HTML widget open up, copy the code from and paste it into the HTML widget, remembering to insert your own p-code where p-test123 appears in the code above
3. Save and publish your site to the web.

Your code should be functional and the newly added HTML widget should be invisible on the published site.

Hope this helps
Photo of Gop


  • 7473 Posts
  • 2115 Reply Likes
Thank you Justin,


Copy the code you have posted here.

Please go to your index page and pull an HTML widget from the side bar to the bottom of your page.

Now paste the code into that HTML widget and SAVE.

IMPORTANT:Replace the "p-test123" code with your own given code. SAVE again.

Publish your page and that should allow the Quantcast facility to pick up your code.

Goodluck with this.