GUIDES
How to configure a purchase event in Google Analytics 4 and Google Tag Manager
First of all you need to setup a GA4 and GTM account, sometimes it already exists to make sure you look for gtm.js
in the network tab.
Once you have your account we need to visit the official GA4 documentation of standard events. See here: https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtm#purchase
The recommended method is utilizing a datalayer and sending instructions to the web developers responsible of the website.
Here's an example of the Purchase event
Go to Google Tag Manager and select a GA4 event tag. Make sure you add the Event parameters and use the datalayer here.
This is an example of how to capture the transaction ID data from the datalayer.ecommerce.transaction_id
As always, make sure to QA, debug and run tests so that you are confident enough in your implementation.
If there's no proper test environment I usually create a test purchase in the live production website and then cancel the order straightaway.
Do you need support to remember your Google Tag Manager implementation? Don't forget to add it to your measurementplan so that you and your team mates can trust the data.