Opened 3 years ago

Closed 3 years ago

#2078 closed Bug (fixed)

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

Reported by: vipsoft Owned by: vipsoft
Priority: critical Milestone: Piwik 1.2
Component: Core Keywords:
Cc: Sensitive: no

Description (last modified by vipsoft)

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:

Change History (7)

comment:1 Changed 3 years ago by vipsoft (robocoder)

  • Description modified (diff)
  • Summary changed from piwik.js: enableLinkTracking() in <head> not working in Safari/Chrome to piwik.js: enableLinkTracking() not working in Safari/Chrome/Webkit

comment:2 Changed 3 years ago by vipsoft (robocoder)

(In [3939]) refs #409:

  • always use Crockford's JSON module (renamed to JSON2) to workaround broken "native implementations"
  • add JSON unit tests
  • revert [3893] 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';
    }
    

comment:3 Changed 3 years ago by vipsoft (robocoder)

  • Description modified (diff)

comment:4 Changed 3 years ago by vipsoft (robocoder)

  • Description modified (diff)

comment:6 Changed 3 years ago by vipsoft (robocoder)

  • Description modified (diff)

comment:7 Changed 3 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from new to closed

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

Note: See TracTickets for help on using tickets.