Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
and change the many occurrences of something = new Date() ... something.getTime() to +new Date (the '+' casts the object to an integer, thus yielding the time in milliseconds).
It's been 4 years, I recommend removing the JSON polyfill as native browser support has improved (and this line means it can no longer polyfill broken JSON implementations):
I'm AFK so I can't test this and submit a PR, but overall is fairly trivial...
The
now
variable here isn't being used in logPageView(), so it can be removed:I suggest getting rid of this workaround:
and change the many occurrences of
something = new Date()
...something.getTime()
to+new Date
(the '+' casts the object to an integer, thus yielding the time in milliseconds).It's been 4 years, I recommend removing the JSON polyfill as native browser support has improved (and this line means it can no longer polyfill broken JSON implementations):
Wrap utf8_encode and sha1 into a polyfill for crypto.subtle.digest.