Quantcast -- Audience Measurement, Lookalike Modeling, Audience Buying

 

Log in

Forgot Password?

Rankings

«

Optimizing Tag Performance Guide

Once you’ve mastered getting Quantified, try these advanced measurement options.

Splitting the Asynchronous Tag

Advanced users can optimize the performance of the Quancast asynchronous tag by splitting the tag into two components as described below. Note: this is just a sample. You must use your own Quantcast-generated tag, found within the home page dashboard.

  1. In the HTML code of your page, insert the following just before the </head> tag:

     

    <!-- Quantcast Tag, part 1 -->
    <script type="text/javascript">
        var _qevents = _qevents || [];
        (function() {
            var elem = document.createElement('script');
            elem.src = (document.location.protocol == "https:" ? "https://secure" : "http://edge")  
                        + ".quantserve.com/quant.js";
            elem.async = true;
            elem.type = "text/javascript";
            var scpt = document.getElementsByTagName('script')[0];
            scpt.parentNode.insertBefore(elem, scpt);  
        })();
    </script>

    Double click the code above to select it.

     

  2. Before the </body> tag and other JavaScript tags, insert the following code. Be sure to use _qevents, not _qoptions:

     

    <!-- Quantcast Tag, part 2 -->
    <script type="text/javascript">
        _qevents.push( { qacct:"p-test123"} );
    </script>
    <noscript>
        <div style="display: none;">
            <img src="//pixel.quantserve.com/pixel/p-test123.gif" height="1" width="1" alt="Quantcast"/>
        </div>
    </noscript>

    Double click the code above to select it.

 

Note – Do not use jQuery.getScript() to download or fire the Quantcast tag, it causes the browser to by-pass its cache, significantly slowing down performance of your pages. Use the Quantcast tag as described here to obtain the best possible performance.





Facebook Twitter LinkedIn YouTube
©2014 Quantcast Corporation