Skip to content

Instantly share code, notes, and snippets.

@nickjacob
Created January 19, 2016 21:12
Show Gist options
  • Save nickjacob/5ccdd5854538036c9f22 to your computer and use it in GitHub Desktop.
Save nickjacob/5ccdd5854538036c9f22 to your computer and use it in GitHub Desktop.

Revisions

  1. Nick Jacob created this gist Jan 19, 2016.
    21 changes: 21 additions & 0 deletions quant-refresh.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    // load the quantcast quant.js
    // replace w/ actual url
    (function (s, h, src) {
    window._qQue = window._qQue || [];
    function _exec(fn){ fn(window.__qc); }
    s.onload = function () {
    window._qQue.forEach(_exec);
    window._qQue.push = _exec;
    };
    s.src = src;
    h.appendChild(s);
    }(document.createElement('SCRIPT'), document.getElementsByTagName('HEAD')[0], 'quant.js');

    function quantCast(_global, event) {
    _global._qevents = _global._qevents || [];

    // firePixels clears the queue
    _global._qQue.push(function(qc){
    qc.qcenqp(event);
    });
    }