Google Tag Manager
How to Use Event Tracking in Google Tag Manager
Last updated
How to Use Event Tracking in Google Tag Manager
Last updated
This guide outlines the process of establishing event tracking for WhatsApp button clicks on your WordPress website. It leverages Google Tag Manager (GTM) to capture user interactions and send data to your preferred analytics platform.
Access your WordPress dashboard > the Settings > Google Analytics integration
Enable the integration specifically for Google Analytics 4 (or Universal Analytics, if available).
Creating two GA4 tags that work together:
Google Analytics: GA4 Configuration
Google Analytics: GA4 Event
To start off, log in to your GTM account and access the container associated with your website.
Select "Tags" from the menu, then click "Add a New Tag".
It will bring up a dashboard for you to set up.
Select Tag type as “Google Tag”
Then, you must enter the GA4 measurement ID into the provided field.
To get the Measurement ID, you need to go to Google Analytics > Data Collection and Modification > Data Streams
Before adding Google Analytics: GA4 Event tag, you have to add new variables. So please navigate to Variables and click New
Choose variable type as Data Layer Variable.
Specify the new variable name by giving it a title as “number” and Data Layer Variable Name as “number”.
Then, please save the new variable, and you can repeat it if you’d like to add more variables.
Now, you create a new tag as Google Analytics: GA4 Event tag. In the tag configuration, specify the Event Name.
For Event Parameters, you can add a new row and enter its Parameter Name and Value, for example, “Phone” with value {{number}}, “Page” with value {{url}}.
Create a Trigger
In the Google Tag Manager interface, create a new trigger.
Set the trigger type to "Custom Event" depending on how the WhatsApp button is implemented.
Set the Event name as “NinjaTeam WhatsApp” and it will trigger fires on “All Custom Events"
Once the tag and trigger configuration is done, you will see two tag types showing like this.
Once confirmed, publish the container.
Real-time Reports:
Go to the "Real-time" section in your GA4 property.
Interact with the WhatsApp button on your website and verify that the event appears in real-time reports.
By following these steps, you can successfully track interactions with the NinjaTeam WhatsApp plugin in Google Analytics 4 and gain insights into user behavior on your website.