Content Sources error

Hi Guys,

Currently we are trying to make the content sources workable on our website. You can see the codes we use below.
We have 3 banners which we use as content sources on our homepage. When we do some testing we get the “impressions” and “clicks” in Piwik so that part seems to work. But the problem is that the page to whom the banners redirect doesn’t open. When we remove the Javascript code the page to whom we redirect is opened. Does anybody now what the problem could be? It seems to be in the Javascript code.

Piwik tracking code

<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
_paq.push(['trackVisibleContentImpressions']);
  (function() {
    var u="//webstats.surf.nl/";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', '3']);
    _paq.push(['trackVisibleContentImpressions']);
    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>
<noscript><p><img src="//webstats.surf.nl/piwik.php?idsite=3" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->



Javascript code 

<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
_paq.push(['trackVisibleContentImpressions']);
  (function() {
    var u="//webstats.surf.nl/";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', '3']);
    _paq.push(['trackVisibleContentImpressions']);
    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>
<noscript><p><img src="//webstats.surf.nl/piwik.php?idsite=3" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code --> 



HTML of the banners

<p><a class="piwikTrackContent" href="/inloggen?pk_campaign=inloggen%20banner&amp;pk_kwd=voor%20het%20eerst%20inloggen%20bij%20SURFspot"><img src="https://test.surfspot.nl/index.php/surfbeheer/cms_wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvSG9tZXBhZ2UtYmFubmVyLU1FSS1ob2Utd2Vya3QtaW5sb2dnZW4ucG5nIn19/key/f669badeb48faccb94fe510880ddc6a3/" alt="" data-content-name="hoeinloggen" /></a></p>
<p><a class="piwikTrackContent" href="/spss?pk_campaign=bannerSPSS&amp;pk_kwd=SPSS" target="_self"><img src="https://test.surfspot.nl/index.php/surfbeheer/cms_wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvSG9tZXBhZ2UtU1VSRnNwb3QtU1BTUzIzYmFubmVyLWtsZWluLXJvb2QucG5nIn19/key/f669badeb48faccb94fe510880ddc6a3/" alt="" data-content-name="spss23" /></a></p>
<p><a class="piwikTrackContent" href="/ict-tegoed?pk_campaign=BannerHomeVoorInlog-UvACrredits&amp;pk_kwd=UvACredits&amp;pk_campaign=bannerUVA&amp;pk_kwd=UVA" target="_blank"><img title="uva banner" src="https://test.surfspot.nl/index.php/surfbeheer/cms_wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvVXZhX2ljdHRlZ29lZF9rbGVpbl9iYW5uZXJOTC5wbmcifX0,/key/f669badeb48faccb94fe510880ddc6a3/" alt="uva banner" data-content-name="uvabanner" /></a></p>Preformatted text

Can you re post the code and use the Preformatted Text button so the forum software doesn’t remove it?

1 Like