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

if JSON2 is not defined correctly, do not use it in piwik.js [JSON2.stringify is not a function] #9130

Closed
thommyhh opened this issue Oct 30, 2015 · 3 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@thommyhh
Copy link

Hi,

after an update to Piwik 2.15.0 the number of tracked visitors dropped to nearly zero. After investigating I found out, that there is a js error in "piwik.js". It's about this website: http://www.statistik-nord.de/

I tried it with Chrome 46 and Firefox 41 and Safari 9 on Mac OS 10.10. and IE11 and Firefox 41 on Windows 7.

Can you give me some feedback here?

@tsteur
Copy link
Member

tsteur commented Oct 30, 2015

It looks like your website is defining a JSON2 as well that defines eg following methods: JSON2.decode, JSON2.encode, JSON2.replaceChars, ...

Did you maybe also make any changes to your website recently?

I quickly tried to reproduce but couldn't. I presume Piwik is defining JSON2 correctly, then it gets changed by the website (I tested setting var JSON2 = {} first and then letting Piwik add methods). This would mean there were changes in your website though which is probably not the case. Need to have a look again

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Nov 1, 2015
@tsteur tsteur added this to the 2.15.1 milestone Nov 1, 2015
@tsteur tsteur self-assigned this Nov 1, 2015
tsteur added a commit that referenced this issue Nov 1, 2015
@tsteur
Copy link
Member

tsteur commented Nov 1, 2015

I prepared a patch. It should be fixed by overwriting your piwik.js in the Piwik directory with this: https://raw.githubusercontent.com/piwik/piwik/9130/piwik.js

With the next release it should be fixed automatically

@thommyhh
Copy link
Author

thommyhh commented Nov 3, 2015

The patch works. Thank you very much.

@mattab mattab changed the title piwik.js broken in 2.15.0 [JSON2.stringify is not a function] if JSON2 is not defined correctly, do not use it in piwik.js [JSON2.stringify is not a function] Jan 29, 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

2 participants