From UA to GA4 with nuxt

Recently we have begun our work to convert our site from Universal Analytics to Google Analytics 4. This project consisted mainly of adding new variables that fit the datamodel that GA4 has and making the Events.

We use GTM so most of the variables are populated from our GTM package in Nuxt. All I had to do was to make javascript variables in GTM that converts the UA values to the GA4 values. One of these is the array of products during checkout which has a completely different structure compared to how it is in the old system.