-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Override matomo window object #6411
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
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for reliable-cocada-166884 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
import { fileSystemUtility, migrationTestData } from '../files/filesystems/fileSystemUtility' | ||
import './styles/preload.css' | ||
import isElectron from 'is-electron' | ||
import { Matomo } from '../plugins/matomo' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't that slow down the loading? did you notice some latency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it does not slow it down.
const _paq = (window._paq = window._paq || []) | ||
const matomo = new Matomo(_paq) | ||
|
||
window._paq = matomo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redefining window._paq here may be tricky, we don't actually know if loader.js has completed its task async loading the tracker code into _paq, and if the window._paq init object has been properly handled by the matomo initializing script. the point of matomo async loading is prevent any delays that would be caused by sync loading the script. so at this point the _paq may just be an array of the init we set in loader, it may not be the tracker at all @yann300 @ioedeveloper
No description provided.