This short guide will help you to setup and track GA4 events.
GA4 property setup
You need to setup GA4 property according to Google instructions.
When GA4 property already set up you need to install gtag.js code to your website.
Go to Admin settings in Google Analytics.
Select Data Streams
Open your website’s stream
In Web stream details go to Configure Tag Settings
Select Installation Instructions
In Installation instructions section you can scan your website or select your website’s platform manually to get instructions
Or you can select Install manually section and get gtag.js code that should be installed in website’s <head> element to every page that you want to track.
Embed code looks like
<!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-GHY8WW59SZ"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-GHY8WW59SZ'); </script>
In case you have already gtag.js code installed on website but with UA property (
UA-.....
) we highly recommend to change it to GA4 property (G-.....
).
Setup custom definitions
Go to Admin settings
Click on Custom Definitions in Data display section
Create custom dimension.
To expand data that will be shown in reports you can use up to 3 event parameters:
event_category
event_label
value
Scope should be Event.
Then you will find these dimensions in reports Engagement → Events.
All TC events has TCW prefix so you can use it to filter events.