Skip to content

Instantly share code, notes, and snippets.

@Albert-IV
Created February 2, 2017 16:06
Show Gist options
  • Save Albert-IV/357d43a6dea638659ce68228f53e54ae to your computer and use it in GitHub Desktop.
Save Albert-IV/357d43a6dea638659ce68228f53e54ae to your computer and use it in GitHub Desktop.
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
//Store Piwiks tracking information so we can reference it later
_paq.push([function() {
// Set global variables
var piwik_visitorId = this.getVisitorId();
var piwik_campaign = this.getAttributionCampaignName();
var piwik_keyword = this.getAttributionCampaignKeyword();
var piwik_referrer = this.getAttributionReferrerUrl();
// And update any elements that depend on the field values
$('.piwik-vid').val(piwik_visitorId);
$('.piwik-campaign').val(piwik_campaign);
$('.piwik-keyword').val(piwik_keyword);
$('.piwik-referrer').val(piwik_referrer);
}]);
(function() {
var u="//suretybonds.piwikpro.com/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 1]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment