Matomo 4 upgrade - does the tracking code need to change

Hi All,

Quick (hopefully) question on the Matomo upgrade - does the core Javascript tracking tag need to be updated on all of the website you are tracking after you upgrade, or is matomo backward compatible with 3.x?

I say this because it looks like the new tracking code has changed slightly

Cheers,
Steve

Hi,

No the tracking code doesn’t need to be changed.

There has just been one change to the tracking code in the recent time (and I think it wasn’t in 4.0.0)

  var _paq = window._paq = window._paq || [];

The window._paq in the middle is new, but it only is needed in cases where you put your tracking code in a function and the older tracking code didn’t work at all in these cases.

1 Like

Smashing - thanks again Lukas