# How to Add Google Tag Manager Tracking Events for Buttons

Tracking events is essential for monitoring user interactions and gathering valuable insights on how visitors engage with your store. By implementing GTM tracking, you can track important actions like button clicks to improve your conversion rate.

**Step-by-step instructions:**

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

{% stepper %}
{% step %}

### Navigate to the Button element in the editor

1. In Foxify studio, find the button element you want to track (such as the "Add to cart" button).
   * Click on the button to open its settings.
     {% endstep %}

{% step %}

### Enable Tracking events

Toggle the **Enable tracking events** switch to "ON".
{% endstep %}

{% step %}

### Set up Google Analytics event tracking

Under **GA Event name**, input the name of the Google Analytics event you'd like to track.&#x20;

A common event name for button clicks is `button_click`, but you can customize this based on your needs.
{% endstep %}

{% step %}

### Integrate Facebook Pixel *(optional)*

If you’re also using Facebook Pixel to track button clicks, you can set up the event for Facebook as well.
{% endstep %}

{% step %}

### Save your changes

Once you've configured the event tracking settings:

* Click **Save** in the top right corner to apply the changes.
* Your button is now set to trigger the GTM and Pixel events when clicked.
  {% endstep %}

{% step %}

### Test the tracking setup

After setting up the tracking events, make sure to test them:

* Open the page in a browser and click the button.
* Use **Google Tag Assistant** or the **Facebook Pixel Helper** extension to verify if the events are being sent correctly to Google Analytics and Facebook.
  {% endstep %}
  {% endstepper %}

{% hint style="info" %}
:star: Tips:

* Ensure you have correctly set up Google Tag Manager and Facebook Pixel on your store before adding tracking events.
* Regularly review your tracking setup to ensure that all necessary events are captured accurately.
* You can add tracking to other buttons or elements by repeating this process for each one.
  {% endhint %}


---

# 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://docs.foxecom.com/foxify-app/faqs-and-troubleshooting/faqs/how-to-add-google-tag-manager-tracking-events-for-buttons.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.
