@dessant opened this Issue on August 3rd 2014

I have changed my user agent to spider for this test, i'm using the proxy mode with this client code:

<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(["setCookieDomain", "*.example.com"]);
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  _paq.push(['appendToTrackingUrl', 'bots=1']);
  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://example.com/";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', 3]);
    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.php'; s.parentNode.insertBefore(g,s);
  })();
</script>

The bots parameter is omitted when the tracking request is sent:

GET http://example.com/piwik.php?action_name=TITLE&idsite=1&rec=1&r=538744&h=18&m=2&s=8&url=http%3A%2F%2Fexample.com%2F&_id=3ddf8ebeff5e69e5&_idts=1407077879&_idvc=1&_idn=0&_refts=0&_viewts=1407077879&pdf=0&qt=0&realp=0&wma=0&dir=0&fla=1&java=0&gears=0&ag=0&cookie=1&res=1366x768&gt_ms=334

If i change back my user agent to the real one, the request is tracked as expected.

@sgiehl commented on August 3rd 2014 Member

Bots are not tracked by default. So as long as the bots=1 is not send with the tracking url, all detected bots will be ignored.
You need to call _paq.push(['appendToTrackingUrl', 'bots=1']); before _paq.push(['trackPageView']); Otherwise the bots=1 parameter will be appended to all requests (on that page) after the inital page tracking request.

This Issue was closed on August 3rd 2014
Powered by GitHub Issue Mirror