Company Centric Script

New generation of UserReport provides single JavaScript snippet that needs to be installed on all websites owned by company.

It looks like

<script src="//sak.userreport.com/clientId/launcher.js" 
  id="userreport-launcher-script"
  async></script>

Script is asynchronous and non-blocking therefore it is recommend to add to <head> section of website. However it is perfectly fine to deploy tag through Google Tag Manager

If you company has bought to other AudienceProject products like AudienceData, AudienceReport they may be deployed to your websites through same script. If you have bought DoubleClick For Publishers realtime targeting or AdForm PPAS targeting - script will be more complex, like shown in example below for DoubleClick For Publishers realtime targeting.

<script>
function getAudienceProjectTargetingData() {
  "use strict";

  var CACHE_KEY = "apr_tdc";
  try {
    var json = window.localStorage.getItem(CACHE_KEY);
    if (json) {
      var cache = JSON.parse(json);
      if (cache.exp > Date.now()) {
        return cache.d;
      }
      else {
        window.localStorage.removeItem(CACHE_KEY);
      }
    }
  }
  catch (err) {
    window.localStorage.removeItem(CACHE_KEY);
  }
  return {};
}

(function () {
  var setTargeting = function () {
    var targetingData = getAudienceProjectTargetingData();
    for (var key in targetingData) {
      if (targetingData.hasOwnProperty(key)) {
        window.googletag.pubads().setTargeting(key, targetingData[key]);
      }
    }
  };

  window.googletag = window.googletag || {};
  window.googletag.cmd = window.googletag.cmd || [];
  if (window.googletag.cmd.unshift) {
    window.googletag.cmd.unshift(setTargeting);
  }
  else {
    window.googletag.cmd.push(setTargeting);
  }
})();

</script>
<script src="//sak.userreport.com/clientId/launcher.js" 
  id="userreport-launcher-script"
  async></script>

Attachments

Comments

Powered by Zendesk