Google Analytics can be upgraded to GA4 by using the Tag Manager setting and topic in the storefront, which is thrown on all pages (assuming the stock script.head.xml.config is still being called in your skin's _Head.cshtml file).
NOTE: GA4 can run alongside basic Universal Google Analytics and Enhanced Ecommerce if desired.
1. Follow the instructions for GA4 using the GA4 Setup Assistant
2. After that, the objective is to get the gtag.js code onto every page.
- This can be done using the existing Script.Google.TagManager topic and the Google.TagManager.Enabled setting.
- Set Google.TagManager.Enabled = true
- Edit the topic Script.Google.TagManager in the admin, click the HTML button, paste in the gtag code from Google Analytics.
In Google Analytics, once you've upgraded your property to GA4 you get this window.
Click the highlighted tag installation arrow:
It takes you to your GA4 property. Click on your property.
On the next window, copy the gtag text circled below and paste it into your Script.Google.TagManager topic:
Copy the gtag text into your Script.Google.TagManager topic, making sure to click the HTML button first.
Save your topic.
The data will take a while to show up in google analytics on your GA4 property.