Use the injected ctx.$ga handler from @nuxtjs/google-analytics instead of window.ga package if it is available.
I myself had some difficulties with the new version of @nuxtjs/google-analytics package which window.ga was not available in the googleOptimize function; but after using the injected $ga handler, it was working fine.
Use the injected
ctx.$ga
handler from@nuxtjs/google-analytics
instead ofwindow.ga
package if it is available.I myself had some difficulties with the new version of
@nuxtjs/google-analytics
package whichwindow.ga
was not available in thegoogleOptimize
function; but after using the injected$ga
handler, it was working fine.