Empty visits content tracking


#1

I implemented content tracking on one of my websites. Now I see a lot of ‘empty’ visits in the visiters log. These occur next to the normal logs. Even since the visitor ID is identical the user gets logged as a new visit so the visitor count increased with 50%.

The unique visits count is still correct.

The extra log occurs on the POST action.

The content tracking is on an internal link


#2

How does your tracking code look like?


#3

  var _paq = _paq || [];
  _paq.push(['trackPageView']);
  _paq.push(["enableLinkTracking"]);
  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://stats.example.com/";
    _paq.push(["setTrackerUrl", u+"piwik.php"]);
    _paq.push(["setSiteId", "58"]);
_paq.push(['trackVisibleContentImpressions']);
    var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
    g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
  })();


<div data-track-content>
<a href="internal"><img src="" data-content-piece/></a>
</div>

I excluded my browser by cookie. And I see myself back in the logs. Again without actions but with the facke referrer URL I use.


#4

ok I can reproduce. Thx!


#5

FYI: I have created an issue for this: Visitors having empty visits when using content tracking · Issue #6296 · matomo-org/matomo · GitHub


#6

Good luck solving it.

Does the 1-second thing also apply to conversions?


#7

Don’t think so. Should work for them.

I’ve a fix that will fix it for all cases but not sure whether we will use this fix or maybe another one.