Learn business growth with Google Analytics 4 › Forums › Google Analytics 4 › Creating a GA4 event using Event Builder for image loading › Reply To: Creating a GA4 event using Event Builder for image loading
-
Yes! To use Google Analytics 4 (GA4) Event Builder, you’ll be dealing with a different setup and format. The Event Builder for GA4 essentially generates a JavaScript command using the gtag.js library, which is different from the image pixel tracking method you were using in the older version of Google Analytics.
Here’s an example of the JavaScript command for tracking a generic event:
gtag(‘config’, ‘GA_MEASUREMENT_ID’, {
‘event_name’: ‘my_event’,
‘event_params’: {
‘parameter_1’: ‘value_1’,
‘parameter_2’: ‘value_2’
}
});In this command, ‘my_event’ is your event name, and ‘parameter_1’ and ‘parameter_2’ are parameters you want to add with the values ‘value_1’ and ‘value_2’ respectively. You typically add these using the GA4 interface and they can be any parameters that are relevant to the event you are tracking.
If you’re attempting to track a conversion event similar to the ‘Always send’ event in Universal Analytics, you’d replace ‘my_event’ with ‘conversion’ and the parameters would be ‘send_to’ with your ‘GA_MEASUREMENT_ID’ in the format ‘GA_MEASUREMENT_ID/conversion’.
It’s important to remember that in GA4, you’ll need to implement this JavaScript command on your confirmation page, different from the previous method where an image tag was embedded. This might require adding it to your page’s HTML or via Google Tag Manager, depending on your set up. Lastly, make sure to test the event to ensure it’s properly tracked in your GA4 interface.