@mgonera opened this Issue on March 14th 2016

From simple test turns out that outlinks are not being tracked in Firefox. Checked on my Mac on newest stable versions of Chrome and FF, Customer tested on Windows versions. Customer that submitted this bug have come up with a suggestion on what might be wrong:

The function "addEventListener" line 1189 in "Piwik.js" (not minifier version) is not taking into account if the document is loaded or not (readyState === complete ) meaning the functions linked to this one are not executed.
It could work if piwik.js is altered at the beginning of the "addEventListener" function (ligne 1189):
if (eventType === "load" && documentAlias.readyState === "complete")
{ eventHandler(); return; }

Please review this and mention me with any further info.

@tsteur commented on March 14th 2016 Owner

What's the tracking code used for this? enableLinkTracking should take care of this and wait for the load event.

@tsteur commented on March 15th 2016 Owner

I debugged the site and found the problem. Basically what happens is that at the point Piwik is loaded, the DOMDocument is already loaded. piwik.js doesn't check for this case in enableLinkTracking (in all other tracking methods it does). Basically, it always thinks the document is not loaded yet and therefore doesn't start searching the DOM for outlinks.

@mattab commented on March 30th 2016 Owner

Good find @tsteur!

This Issue was closed on March 31st 2016
Powered by GitHub Issue Mirror