# Google Tag Manager

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.

#### Step 1: Configure Your WhatsApp Plugin

Access your WordPress dashboard > the Settings > Google Analytics integration

Enable the integration specifically for Google Analytics 4 (or Universal Analytics, if available).

<figure><img src="/files/KmV4JlMnHZNXq2uvpwvw" alt=""><figcaption></figcaption></figure>

#### Step 2: Setting Up Google Tag Manager

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.&#x20;

Select "Tags" from the menu, then click "Add a New Tag".&#x20;

<figure><img src="/files/NjmFmO93UkS2KVpvwOzs" alt=""><figcaption></figcaption></figure>

It will bring up a dashboard for you to set up.

* Select Tag type as “Google Tag”

<figure><img src="/files/KPH3vhttY9vzWnVPbJlU" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/ZN50tO7aemRq6A8LQyK6" alt=""><figcaption></figcaption></figure>

Before adding Google Analytics: GA4 Event tag, you have to add new variables. So please navigate to Variables and click New

<figure><img src="/files/dRPDtnxG5Kf4nZoljxTQ" alt=""><figcaption></figcaption></figure>

Choose variable type as Data Layer Variable.

<figure><img src="/files/MbX9ZpVJUAjGUnS44xG3" alt=""><figcaption></figcaption></figure>

Specify the new variable name by giving it a title as “number” and Data Layer Variable Name as “number”.

<figure><img src="/files/yyGSULQTrg83AfC5MYjq" alt=""><figcaption></figcaption></figure>

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.&#x20;

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}}.

<figure><img src="/files/tlZNVGsnM87axF9plNud" alt=""><figcaption></figcaption></figure>

#### Step 3: Implement Tracking Using Google Tag Manager (GTM)

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.

<figure><img src="/files/mDaCpY5iS9AzWzMCpEwp" alt=""><figcaption></figcaption></figure>

Set the Event name as “NinjaTeam WhatsApp” and it will trigger fires on “All Custom Events"

<figure><img src="/files/EiqJks7ilV8Az7B3mfuX" alt=""><figcaption></figcaption></figure>

Once the tag and trigger configuration is done, you will see two tag types showing like this.

<figure><img src="/files/qmz62qegbCvllYeBWXGw" alt=""><figcaption></figcaption></figure>

Once confirmed, publish the container.

#### Step 4: Verify Events in Google Analytics 4

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.

<figure><img src="/files/VHAwxQWSMVZJMIElX1Wj" alt=""><figcaption></figcaption></figure>

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.

\
\
\
\
\
\
\ <br>

\
\ <br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ninjateam.gitbook.io/whatsapp-for-wordpress/settings/google-tag-manager.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
