---
updatedAt: 2025-12-08T15:12:37.000Z
---

# Add event pixels in Google Tag Manager (using custom HTML)

Add event pixels in GTM, using HTML code snippets.

# Overview

Now that you have added the [ *base* pixel](https://developers.taboola.com/pixel/docs/the-base-pixel) to your website, you are ready to add 1 or more *event*  pixels.

*Event*  pixels enable you to track conversions and gather important insights - e.g. ROAS (Return On Ad Spend).

To add the  *event* pixel using custom HTML (*no editing required*), follow the guidelines below.

> 👍
>
> Depending on the event that you need to track, custom development may be required.

> 📘 See also
>
> * For a list of available flows, see: [Event pixels](https://developers.taboola.com/pixel/docs/event-pixels)
> * For an overview of conversion tracking, see: [Conversion tracking](https://developers.taboola.com/pixel/docs/conversion-tracking-overview)

> 🚧 URL-based conversions
>
> <a href="https://help.taboola.com/hc/en-us/articles/360003484314-Defining-and-Creating-Conversions" target="_blank">URL-based conversions</a> rely on the [*base* pixel](https://developers.taboola.com/pixel/docs/the-base-pixel)  *only* - they do not require an *event* pixel.

> 🚧
>
> **Shopify** store owners should use our [Shopify app](https://developers.taboola.com/pixel/docs/conversion-tracking-for-shopify).

# High-level flow

Tracking an *event-based* conversion requires the following steps:

> 📘 End-to-end flow
>
> **In Realize**:
>
> 1. Edit or add an **event-based conversion**.
>
> **In  GTM**:
>
> 1. Add an event **trigger**.
>    > This may require custom development. See: [Trigger types](#trigger-types)
> 2. Add the *event* pixel **tag**.
>
> ***
>
> The **`Event Name`** fields in **GTM** *and* **Realize** must have identical values.

# Realize setup

## Edit an existing conversion

If you already created a conversion in **Realize**, open it and copy the relevant code snippet:

1. Open <a href="https://ads.realizeperformance.com/tracking" target="_blank">Realize</a>, and select the account (*top, left*) that you will use to track conversions.
2. In the sidebar (*left*), select `Tracking`.
3. Click on the `Edit` icon for the relevant event-based conversion rule.
4. Scroll down to the **`Event Code`** section.  Mouse over the code snippet and click on `COPY TO CLIPBOARD`.
5. Keep **Realize** open and continue with the **GTM** setup [below](#gtm-setup).

## Create an event-based conversion

If you have not yet created a conversion in **Realize**, create it now:

> 📘
>
> The instructions below illustrate the steps for setting up a **registration event**.
>
> Other conversions - e.g. a **purchase event** - require slightly different steps.
>
> ***
>
> For additional guidelines, see the <a href="https://help.taboola.com/hc/en-us/articles/360003484314-Defining-and-Creating-Conversions" target="_blank">Help Center</a>.

1. Open <a href="https://ads.realizeperformance.com/tracking" target="_blank">Realize</a>, and select the account (*top, left*) that you will use to track conversions.
2. In the sidebar (*left*), select `Tracking`.
3. Click on `+ New Conversion` (*far right*).
   > Select `Create conversions using code` and click `Continue`.
4. Type in a `Conversion Name` of your choice - e.g. `Complete Registration`.
   > This is a descriptive name for your convenience. It need not match any value in **GTM**.
5. For `Conversion Type`, select `EVENT`:

   ![](https://files.readme.io/5f13e3507036a532e31d31a0edc75535996be4f8391738dbb59470b0549bbffd-image.png)
6. If relevant, fill in a `Fixed Value`.
   > **Tip**: If the event includes a dynamic value - e.g. a purchase event - leave this field blank. For additional guidelines, see the <a href="https://help.taboola.com/hc/en-us/articles/360003484314-Defining-and-Creating-Conversions" target="_blank">Help Center</a>.
7. Select the relevant `Category` - e.g. `Complete Registration`.
8. Confirm that the `Event Name` is `complete_registration`.
   > 🚧
   >
   > The `Event Name` fields in **Realize** and **GTM** must have *identical* values.\
   > Otherwise, **Taboola** will not be able to receive events passed by **GTM**.
9. (*Optional*) If desired, edit the following fields:
   1. `Click Through Conversion Window`
   2. `View Through Conversion Window`
10. (*Optional*) If relevant, clear the `Include in total conversions` checkbox.
    > **Tip**:  Always include the most important conversions, so that the **Taboola** algorithm will optimize towards them. For additional guidelines, see the <a href="https://help.taboola.com/hc/en-us/articles/360003484314-Defining-and-Creating-Conversions" target="_blank">Help Center</a>.
11. (*Optional*) If relevant, clear the `Include in total value` checkbox.
12. (*Optional*) If desired, edit the following fields:
    1. `Audience Properties`
    2. `Aggregation Type`
13. Under  the **`Event Code`** section:
    1. (*Optional*) If relevant, select 1 or more `dynamic parameters`.
       > Note how the code snippet updates accordingly.\
       > For detailed guidelines, see: [Track dynamic conversion values](https://developers.taboola.com/pixel/docs/track-dynamic-values)
    2. Mouse over the code snippet and click on `COPY TO CLIPBOARD`.
14. Review your chosen settings, and click on **`Create`** (*bottom, right*):

    ![](https://files.readme.io/fa269a77ee497993379a201ca8816e4adccba89378d05b21619087e2462ca812-image.png)
15. Keep **Realize** open and continue with the **GTM** setup below.

# GTM setup

## First steps

If you have not already done so, open your **Google Tag Manager** workspace:

1. Open <Anchor label="Google Tag Manager" target="_blank" href="https://tagmanager.google.com/">Google Tag Manager</Anchor>.
   > (You may be prompted to log in with Google.)
2. Under **`Container Name`** (*left*), click on the relevant container.
   > Note the `Container ID` (`"GTM-XXXXXXXX"`) on the *far right*.
   >
   > (You can change your selection later, by clicking in the *top, left* corner.)
3. Select a workspace (*top, left*), or just use the `Default Workspace`:

   <Image align="left" border={false} src="https://files.readme.io/6f7a4f684adda8889bab96f26eef2f3f4978941f46c35ae722943322a2d278fc-image.png" />

## Add a GTM trigger

> 📘
>
> If you prefer, you can perform this step later, while [adding the event pixel](#add-the-event-pixel) (*next section*).

In your **GTM** dashboard:

1. In the navigation panel (*left*), select **`Triggers`**:

   <Image align="left" src="https://files.readme.io/e924a9a707f51cdcb5942699dda24163298fda11ad0d6e1b2a524a996a066465-image.png" />
2. Click on **`New`** (*top, right*):

   <Image align="left" src="https://files.readme.io/f292e02e9593a43ac1d4d8fed49e54784dc58069fe9f4cb5696579adb5df5643-image.png" />

   <br />
3. Click on the **`Trigger Configuration`** card.
4. Choose the relevant trigger type, and configure it as needed.
   > See: [Tips & Techniques > Trigger Types](#trigger-types) (*below*).
5. Click on **`Save`** (*top, right*):

   ![](https://files.readme.io/6d1068b03b7c9690d11330c547157e67ebc11e835c451aa49fd816369cb30c0e-image.png)

## Add the GTM tag

In your **GTM** dashboard:

1. In the navigation panel (*left*), select **`Tags`**.

   <Image align="left" src="https://files.readme.io/4ed41ffb8261d24776b36e2b0630023020e78409a8af4aa5f07afb52f131e6da-image.png" />

   <br />
2. Click on **`New`** (*top, right*):

   <Image align="left" src="https://files.readme.io/f292e02e9593a43ac1d4d8fed49e54784dc58069fe9f4cb5696579adb5df5643-image.png" />

   <br />
3. Click on the **`Tag Configuration`** card.
4. Under **`Custom`**, select **`Custom HTML`**.
5. Paste in the code snippet that you obtained from **Realize** in the previous section (using the `COPY TO CLIPBOARD` option).
6. For `Pixel Type`, select`Event pixel`.
7. Select the relevant `Event Name` from the dropdown provided - e.g. `complete_registration`.
   > 🚧
   >
   > The `Event Name` fields in **Realize**  ([*above*](#taboola-ads-setup)) and **GTM**  must have identical values.
   >
   > (Not to be confused with the `Conversion Name` field in **Realize**, which is merely descriptive.)
8. Click on the **`Triggering`** card, to set up a trigger for this event.
9. Select the trigger that you created above (*previous section*), or click on the **`+`** icon (*top, right*) to define one on-the-fly.
   > See: [Tips & Techniques > Trigger Types](#trigger-types) (*below*).
10. Once your tag configuration is complete, click on **`Save`** (*top, right*):

    <Image align="left" className="border" border={true} src="https://files.readme.io/1bec119df693baf55fdd1717ef3d60b948b2a0dd7293d458ca3b4aeec8702ce8-image.png" />
11. When prompted, enter a descriptive name for the tag - e.g. **`Taboola Event Pixel - Subscription Event`**.

> 🚧
>
> At this stage, your changes are not live - you still need to *publish* them.

## Preview your changes (*optional*)

Although, you have added the tag within **GTM**, your changes are not live yet - you still need to *publish* them.

You can optionally *preview* (test-drive) your changes before you publish them. If you prefer to publish your changes immediately, skip ahead to the [next section](#publish-your-changes).

> 🚧
>
> The **`Publish`** action will publish *all* recent changes - including changes made by other team members within this **GTM** workspace.

> 📘 When to use preview
>
> 1. Other team members are making changes in the *same* **GTM** workspace.
> 2. You want to confirm your setup *before* you publish it.
> 3. You want to test why a tag is not working as expected.

In your **GTM** dashboard:

1. Click on **`Preview`** (*top, right*).
2. Enter the URL of the page where the customer journey begins (e.g. the landing page). Then click on **`Connect`**:
   1. The **Tag Assistant** is opened in a new *tab*.
   2. If the connection is successful, your webpage is opened in a separate  *window*.
3. Once a connection is made, click on **Continue**.
4. Review the **`Output`** window to see which tags were fired:

   ![](https://files.readme.io/10447cfd550a0144a171037fa53565cd9f35b90d6fd6ba0df15003e026f1a77a-image.png)
5. Click on the **`Close`** icon (*top, left*) to stop debugging:

   <Image align="left" src="https://files.readme.io/3ac1b5abe294d190892c5b7114a6c758a9092799153566de39fd175df85f9dc4-image.png" />
6. Once you are done with the **Tag Assistant**, close the browser tab.

## Publish your changes

> 🚧
>
> The **`Publish`** action will publish *all* recent changes - including changes made by other team members within this **GTM** workspace.

1. Click on **`Submit`** (*top, right*).
2. Review the **`Workspace Changes`**.
   > This is the set of changes that will be deployed.
3. (*Optional*) Enter the following fields:
   1. `Version Name` - e.g. `"Taboola Event Pixel - Subscription Event"`
   2. `Version Description` - e.g. `"Added the Taboola Event Pixel - Subscription Event"`.\ <br />
      > The above fields can help when reviewing a history of changes to your **GTM** container.\ <br />
4. While you wait for **GTM** to publish your changes, sing like no one is listening :)
5. Once published, a summary page appears.

# What's next?

Well done! You have added an *event* pixel, and set up your event-based conversion!

Next, you should [verify](https://developers.taboola.com/pixel/docs/verification-overview) that everything is running smoothly.

# Tips & techniques

The sections below contain different tips & techniques that can help with your integration.

> 👍 Tip
>
> After you click through to [Tips & Techniques](#tips--techniques), you can use the browser **`Back`** button to get back.

## Trigger types

Depending on the trigger type, custom development may be required. Some sample use cases are presented below.

### Case 1 - Separate `Thank You` page

If a successful registration loads a separate `Thank You` page (with its own URL), you can set up a **GTM** trigger without custom development.

> Alternatively, you could set up a <a href="https://help.taboola.com/hc/en-us/articles/360003484314-Defining-and-Creating-Conversions" target="_blank">URL-based conversion</a> in **Realize**, and skip the event pixel setup altogether. However, for the purpose of this example, we will use an event-based conversion.

Your flow would look something like this:

#### GTM dashboard

In your **GTM** dashboard:

1. In the navigation panel (*left*), select **`Triggers`**:

   <Image align="left" src="https://files.readme.io/e924a9a707f51cdcb5942699dda24163298fda11ad0d6e1b2a524a996a066465-image.png" />
2. Click on **`New`** (*top, right*):

   <Image align="left" src="https://files.readme.io/f292e02e9593a43ac1d4d8fed49e54784dc58069fe9f4cb5696579adb5df5643-image.png" />

   <br />
3. Click on the **`Trigger Configuration`** card.
4. Choose `Page View` as the trigger.
5. Choose `Some Page Views`.
6. Select `Page URL` and `contains` and type in a fragment of the URL - e.g. `"thankyou.php"`.
7. Once your tag configuration is complete, click on **`Save`** (*top, right*):

   <Image align="left" className="border" border={true} src="https://files.readme.io/1bec119df693baf55fdd1717ef3d60b948b2a0dd7293d458ca3b4aeec8702ce8-image.png" />
8. When prompted, enter a descriptive name for the trigger - e.g. **`Subscription Event Trigger`**.

### Case 2 - `Thank You` pop-up

If the `Thank You` message displays on the same page - e.g. via a pop-up - some custom development is needed.

Your flow might look something like this:

#### dataLayer.push

> (Requires custom development)

1. Prepare a **Data Layer event** code snippet. For example:
   ```javascript
   window.dataLayer = window.dataLayer || [];
   window.dataLayer.push({
     'event': 'registrationComplete'
   });
   ```
2. Ask your web developer to update your registration funnel so that the above script is fired for each successful registration.
3. (*Optional*) **`Preview`** your website in the **GTM** dashboard, and confirm that the event is fired.> See Preview your changes (*above*)

You are now ready to set up the event in the **GTM** dashboard (*next section*).

#### GTM dashboard

In your **GTM** dashboard:

1. In the navigation panel (*left*), select **`Triggers`**:

   <Image align="left" src="https://files.readme.io/e924a9a707f51cdcb5942699dda24163298fda11ad0d6e1b2a524a996a066465-image.png" />
2. Click on **`New`** (*top, right*):

   <Image align="left" src="https://files.readme.io/f292e02e9593a43ac1d4d8fed49e54784dc58069fe9f4cb5696579adb5df5643-image.png" />

   <br />
3. Click on the **`Trigger Configuration`** card.
4. Choose `Custom Event` (under `Other`) as the trigger.
5. Type in an event name, exactly as it appears in the **Data Layer event** code snippet that you prepared above - e.g. `registrationComplete`.
6. Click on **`Save`** (*top, right*):

   <Image align="left" className="border" border={true} src="https://files.readme.io/1bec119df693baf55fdd1717ef3d60b948b2a0dd7293d458ca3b4aeec8702ce8-image.png" />

   <br />
7. When prompted, enter a descriptive name for the trigger - e.g. **`Subscription Event Trigger`**.

<br />

## Additional resources

In-depth coverage of **GTM** and the **GTM Data Layer** is beyond the scope of this article. For your convenience, some additional resources are provided below.

> 📘 GTM Data Layer
>
> * [Google Tag Manager Custom Event Trigger Explained](https://www.analyticsmania.com/post/what-is-data-layer-in-google-tag-manager/)  (An in-depth tutorial for beginners)
> * [The data layer](https://developers.google.com/tag-platform/tag-manager/datalayer) (The official GTM docs)

> 📘 GTM Preview
>
> * [A Guide To Google Tag Manager Preview Mode](https://www.analyticsmania.com/post/google-tag-manager-debug-mode/) (An in-depth tutorial for beginners)