Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outlinks and downloads not being tracked in Firefox #9924

Closed
mgonera opened this issue Mar 14, 2016 · 3 comments
Closed

Outlinks and downloads not being tracked in Firefox #9924

mgonera opened this issue Mar 14, 2016 · 3 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@mgonera
Copy link

mgonera commented Mar 14, 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.

@mgonera mgonera changed the title Outlinks not being tracked in Firefox Outlinks and downloads not being tracked in Firefox Mar 14, 2016
@tsteur
Copy link
Member

tsteur commented Mar 14, 2016

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

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Mar 15, 2016
@tsteur tsteur added this to the 2.16.1 milestone Mar 15, 2016
@tsteur tsteur self-assigned this Mar 15, 2016
@tsteur
Copy link
Member

tsteur commented Mar 15, 2016

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
Copy link
Member

mattab commented Mar 30, 2016

Good find @tsteur!

tsteur added a commit that referenced this issue Mar 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

3 participants