# Track affiliate performance with GTM/Facebook Pixel

If you're looking to track affiliate signups, logins, and page visits, you can integrate either **Google Tag Manager (GTM)** or **Facebook Pixel** into your affiliate portal in **Settings > Affiliate portal**&#x20;

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

### Google Tag Manager

**1. Get your Container ID**\
If you don’t already have a GTM account:

* Go to <https://tagmanager.google.com>
* Click **Create Account**
* Set up a container for your Shopify store
* Choose **Web** as the target platform
* After setup, you will receive a GTM ID like `GTM-XXXXXXX`

**2. Enter your GTM ID**

* In Shopify admin, go to **Affiliate Portal Tracking**
* Click on **Google Tag Manager**
* Enter your **GTM Container ID**
* *(Optional)* Enter a **Signup Conversion Event** name (e.g., `affiliate_signup`)
* Click **Save**

**3. Create a Custom event trigger**

* In GTM, go to **Triggers** → **New**
* Choose trigger type: **Custom Event**
* Event name: match the one you entered above (e.g., `affiliate_signup`)
* Save the trigger

**4. Create a Tag to fire on signup**

* Go to **Tags** → **New**
* Choose a tag type (e.g., Google Ads Conversion Tracking, GA4 Event, etc.)
* Link the trigger from step 3
* Save and publish your container

### Facebook Pixel

**1. Create your Facebook Pixel ID**

* Go to Facebook Events Manager
* Click **Connect Data Sources** → Choose **Web**
* Select **Facebook Pixel** and click **Connect**
* Follow the steps and you will get a **Pixel ID** (a long numeric string)

**2. Enter your Pixel ID**

* In Shopify admin, go to **Affiliate Portal Tracking**
* Click on **Facebook Pixel**
* Enter your **Pixel ID**
* *(Optional)* Enter a **Signup Conversion Event** (e.g., `AffiliateSignup`)
* Click **Save**

**3. Set up a Custom Event**

* After a signup, the app will send a `fbq('trackCustom', 'AffiliateSignup')` event (or your chosen event name)
* In **Events Manager**, go to **Custom Conversions**
* Click **Create Custom Conversion**
  * Select your Pixel
  * Set **Event Name** = your custom event (e.g., `AffiliateSignup`)
  * Add rules if needed (e.g., URL contains `/signup-success`)
  * Click **Create**

{% hint style="info" %}

* You can use GTM to manage both Google Ads and Facebook Pixel centrally.
* Use the signup event to create retargeting audiences, optimize conversions, or measure ad performance.
* GTM and Facebook Pixel both support debugging tools like **Tag Assistant** and **Pixel Helper** for troubleshooting.
  {% 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.bixgrow.com/track-affiliate-performance-with-gtm-facebook-pixel.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.
