var _paq = _paq || ;
When people copy paste this line and code into other places like inside Tag manager containers, and this line is copied, then the _paq value ends up being set to empty array, because the global _paq is not available in the function scope.
But we want to make it easy for users to copy paste bits of the code without breaking things.
By changing the line to the line below, we make sure to always read the global _paq:
var _paq = window._paq || ;
window._paqdoes not risk triggering errors on some browsers?
Confirm that using window._paq does not risk triggering errors on some browsers?
To be safe, just use
window['_paq']. That is supported by all browsers.
var _paq = window._paq || ; and
window._paq = window._paq || ; on browsers back to IE6 and Firefox 3 and worked fine. It's bit easier / nicer to read than
It's fine for me.