piwik.js: enableLinkTracking() not working in Safari/Chrome/Webkit #2078

robocoder opened this Issue Feb 9, 2011 · 3 comments

1 participant


Reported in http://forum.piwik.org/read.php?2,71966

Upon further investigation, webkit doesn't track outlinks (whether the tracking code is in head or body) unless the anchor has a target to open in a new window/tab. Tracking piwik.js execution, the request is created but webkit suppresses the request. (Security feature?)

There is already an open ticket in webkit's trac, and apparently also affects GA (so, we are not alone), but I've opened a new one with more details and an example:


(In [3939]) refs #409:

  • always use Crockford's JSON module (renamed to JSON2) to workaround broken "native implementations"
  • add JSON unit tests
  • revert [and 3900; rewrite getVisitorId() per comment:80
  • refactor browser feature detection for fingerprinting (used to generate uuid)
  • setDomains() now takes either '*.domain' or '.domain'
  • Safari emits warnings for Content-Length and Connection as "unsafe headers" in XHR POST request

refs #1984:

  • partially revert [3882] in order for the unit tests to run
  • fix inconsistency in getCustomVariable() depending on whether it is loaded from memory or from a cookie

refs #2078 Webkit bug ("Failed to load resource") when link target is the current window/tab

  • requires further discussion because the workaround may not be desirable behavior, i.e.,
if ((new RegExp('WebKit')).test(navigatorAlias.userAgent)
    && (!sourceElement.target.length || sourceElement.target === '_self')
    && linkType === 'link')
    // open outlink in a new window
    sourceElement.target = '_blank';

(In [3940]) refs #2078


Updated FAQ "Piwik doesn't track Downloads and Outlinks on my website.".

@robocoder robocoder added this to the Piwik 1.2 milestone Jul 8, 2014
@robocoder robocoder self-assigned this Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment