With the switch from Universal Analytics to Google Analytics 4, collecting data from your website will be more detailed and a bit more complicated. All Ga3 support has ended and you need to have Ga4 set up.
The most efficient way to collect activity data from your website is by using Google Tag Manager and event triggers such as clicks, form submissions, file downloads, etc. There is a list of recommended events and automatically collected events for Google Analytics. You can also create custom events based on your specific needs.
We’ll go over an example set up for tracking custom events with Google Tag Manager.
Adding Custom Event Tracking
In Tag Manager, you need to configure a new tag for Google Analytics 4 to track a custom event. Our example will be for telephone tracking clicks on one of our websites.
Step 1: Go to the left side menu and choose “Variables” and then click “Configure” on the top right:
Step 2: Check all click variables:
Step 3: Choose trigger type – Just Links:
Step 4: Choose “Some Link Clicks”, then “Click URL”, “starts with”, and add “tel:”:
Step 5: Choose Tag Configuration > Google Analytics > GA4 Event:
Step 6: Add measurement ID (found in your Google Analytics page under “data streams”:
Step 7: Choose a name for the event such as click_to_call:
Step 8: Set Event Parameters. Choose “Click URL” for both fields:
Step 9: To test your new event, click preview:
Step 10: Add your URL and click connect:
Step 11: Click one of your phone number links and confirm the tag was fired:
Step 12: Go to Google Analytics Admin Settings > Data Display > Custom Dimensions > Create Custom Dimension:
Step 13: Search for “click_to_call” Events by going to Engagement > Events > Click through the “click_to_call” event row to see a detailed reporting screen for that one event:
When looking at the detailed reporting screen for each event, the parameters aren’t usually reported on. With a Custom Dimension defined for the “click_url” parameter, the detailed reporting screen for the “click_to_call” event will now contain a special card for the Click URL mapping created in Steps 8 + 12. This is because this event contains the parameter in question. If the event doesn’t contain that parameter, this card will not be seen.