Google Tag Manager

DCO Pixel > Set up with Google Tag Manager

πŸ“

This section refers to the Taboola DCO solution. For the standard e-commerce solution, see here.

The Google Tag Manager (GTM) is a tool that allows you to add and update tags and code snippets, such as conversion tracking and site analytics, without editing your website's code.

What is a tag?

A tag is a piece of code provided by marketing or analytics platforms to send information to them (e.g., Taboola Pixel, Facebook Pixel, Google Analytics Tracking Code, Remarketing Tags, etc.).

What is the E-commerce Taboola pixel template?

The E-commerce Taboola pixel template (for Google Tag Manager) allows marketers to easily implement the DCO pixel without the need to know how to code.

πŸ“Ί

Video instructions

Prefer to watch a video? Check out our step-by-step video guide for GTM setup.

GTM setup overview

The GTM implementation consists of 3 steps:

  1. Add the template - Install the Taboola template from GTM gallery (one-time)
  2. Configure base pixel and HEM - Set up page view tracking with hashed email matching (one-time)
  3. Add e-commerce event tags - Create tags for each tracking event (repeat as needed)

Step 1: Add the Taboola template

In your GTM workspace:

  1. In the navigation panel (left), select Templates:

  2. In the Tag Templates section, click on Search Gallery.

  3. Search for and select the E-commerce Taboola pixel template.

    For DCO, make sure to select the above template (and not the Taboola Pixel template).

  4. Click Add to workspace and confirm by clicking Add.

Step 2: Configure base pixel and HEM

Configure HEM (hashed email matching)

Before creating your base pixel tag, you need to set up email tracking. This allows Taboola to identify returning users while maintaining privacy.

🚧

Mandatory for DCO

Hashed email addresses are required for DCO campaigns. They enable better user identification and personalization while maintaining privacy through one-way SHA-256 encryption.

Implementation overview

The Taboola GTM template supports 2 methods for sending user emails:

  1. Pre-hashed email (recommended) - Your website hashes the email before sending it to GTM
  2. Non-hashed email - GTM automatically hashes the email using the template

Choose the method that works best for your technical setup, then follow the corresponding instructions below.

🚧

Privacy consideration

Ensure you have proper user consent to share email addresses with third-party services per your privacy policy and applicable regulations.

Method 1: Pre-hashed email (recommended)

When to use: If your development team can implement email hashing on your website.

Requirements:

  • Email must be converted to lowercase
  • Hash using SHA-256 encryption
  • Pass the hashed value to GTM via data layer

Setup steps:

  1. On your website: Implement email hashing to create a hashed email value in your data layer.

    πŸ“˜

    Implementation guide

    For code examples on how to hash emails (JavaScript and PHP), see our Hashing User Emails guide.

  2. In GTM: Create a User-Defined Variable:

    • Navigate to Variables section
    • Click New under User-Defined Variables
    • Name it "Hashed Email"
    • Configure it to read the pre-hashed email from your data layer
    • Click Save
Method 2: Non-hashed email

When to use: If you cannot implement hashing on your website, or prefer GTM to handle it.

Setup steps:

  1. On your website: Make the plain email address available in your data layer.

  2. In GTM: Create a User-Defined Variable:

    • Navigate to Variables section
    • Click New under User-Defined Variables
    • Name it "User Email"
    • Configure it to read the plain email from your data layer
    • Click Save

Create the base pixel tag

The base pixel tracks page views across your entire site. You'll create this tag once.

Return to your GTM workspace:

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

  2. Click on New (top, right).

  3. In the Tag Configuration panel, select the E-commerce Taboola pixel template that you added.

  4. Name your tag (e.g., "Taboola - Base Pixel").

  5. Enter your Account ID (also called Advertiser ID). This is provided by your Taboola account manager.

    🚧

    Important

    Use the Advertiser ID supplied by your DCO Account Manager. This is NOT the same as your DCO Seat ID.

  6. From the Event Type dropdown, select Base Pixel - Page View.

  7. Connect your email variable to the appropriate field:

    • If using Method 1: Select your "Hashed Email" variable in the Hashed Email field
    • If using Method 2: Select your "User Email" variable in the Non-Hashed Email field
  8. Under Advanced Settings, select Once per Page under tag firing options.

  9. Under Triggering, select All Pages.

  10. Click Save.

Your base pixel is now configured and will track page views and enable hashed email matching.

Step 3: Add e-commerce event tags

Now you'll create tags for each e-commerce event you want to track (e.g., PRODUCT_VIEW, ADD_TO_CART, PURCHASE).

πŸ“˜

Repeat for each event

You'll repeat these steps for each mandatory event and any optional events you want to implement.

Create an event tag

In your GTM workspace:

  1. Navigate to Tags and click New.

  2. In the Tag Configuration panel, select the E-commerce Taboola pixel template.

  3. Name your tag based on the event (e.g., "Taboola - Product View").

  4. Enter your Account ID (same as base pixel).

  5. From the Event Name dropdown, select the event you want to track.

  6. Under Event Parameters, provide the required parameters for the selected event (see Event parameters below).

  7. Connect your email variable to the appropriate field (Hashed Email or Non-Hashed Email) - same as base pixel.

  8. Under Advanced Settings, select Once per Event under tag firing options.

  9. Configure Triggering using one of the following options:

    Option A: Google Analytics 4 (GA4) or Universal Analytics (UA) event configuration

    Use this option if you have already set up supporting data layers on your website.

    1. Click Choose a trigger to make this tag fire
    2. Click the + (PLUS) symbol
    3. Click Choose a trigger type to begin setup
    4. Select Custom Event
    5. Enter a name that EXACTLY MATCHES what was configured in your data layer on your site
    6. Click Save

    Option B: Manual event configuration

    Set up the trigger according to your site's requirements. If you wish to track clicks, configure a click trigger. For scroll-based tracking, set up a scroll depth trigger.

    πŸ“˜

    Learn more about GTM triggers

    You need to set these triggers in advance. For more information, see Google Tag Manager triggers documentation.

  10. Click Save.

Repeat these steps for each event you want to track.

Event parameters

The following tables show the GTM variables you need to configure for each event. When setting up an event in GTM, select the appropriate GTM variable that returns the required data from your website's data layer.

πŸ“˜

Data layer options

If your site uses Google Analytics 4 (GA4) or Universal Analytics data layer structure, many of these fields may be automatically populated when you enable the corresponding checkbox in the tag configuration. For sites without these data layers, you'll need to manually configure each parameter.

πŸ“˜

E-commerce terminology

Due to technical requirements, the pixel uses e-commerce terminology (e.g., productIds, cartDetails) across all verticals. See your industry tab below for how to interpret these fields.

Select your industry to see the relevant GTM event configuration:

Event

Description

Parameters

Product View (Mandatory)

The user viewed the info page of an item.

Product IDs (Mandatory)
String/Array of strings/strings separated by commas
Select the GTM Variable that returns the main Product ID in the current page.
Examples: ["sku1"], "sku1"


The Product ID value must match one of the product identifier columns (e.g., GTIN, SKU, MPN, etc.) in your feed. Product ID values passed for Product View event should be consistently passed across all other events.

Purchase (Mandatory)

A purchase was made.

Cart Details (Mandatory)
Array of objects
Select the GTM Variable that returns an array containing the quantity, product ID and the unit price of each item in the user's cart.
Example: [{productId: "sku1", quantity: 3, price: 22.45}, {productId: "sku2", quantity: 4, price: 15.76}]

Important: Use the exact structure shown above. Attribute names MUST remain unchanged (use productId not ID).


Order ID (Mandatory)
String
Select the GTM Variable that returns the Order ID of the current transaction. This ID should be unique per Order.


Value (Mandatory)
Number (Decimal)
The total value of the purchase in the given currency.
Example: 9.99


Currency (Mandatory)
String
The currency used in the cart in ISO 3-letter currency code notation.
Example: "USD"

Add to Cart (Mandatory)

A product was added to the shopping cart.

Product IDs (Mandatory)
String/Array of strings/strings separated by commas
Select the GTM Variable that returns Product IDs in the current page.
Examples: ["sku1"], ["sku1", "sku2"]

Search (Optional)

A search results page was displayed to the user. Send the first 5 product IDs of the search result.

Product IDs (Optional)
String/Array of strings/strings separated by commas
Select the GTM Variable that returns Product IDs of the first 5 products in the result list.
Example: ["sku1", "sku2", "sku3", "sku4", "sku5"]


Search Term (Optional)
String
Select the GTM Variable that returns the search term entered by the user.
Example: "long dress"

Category View (Optional)

A list of products was displayed to the user by browsing a category. Send the first 5 product IDs.

Product IDs (Optional)
String/Array of strings/strings separated by commas
Select the GTM Variable that returns Product IDs of the first 5 products in the result list.
Example: ["sku1", "sku2", "sku3", "sku4", "sku5"]


Category (Optional)
String
Select the GTM Variable that returns the name of the category being viewed.
Example: "Womens Shoes"


Category ID (Optional)
String
Select the GTM Variable that returns the ID of the category being viewed.

Home Page Visit (Optional)

The home page was displayed to the user.

No additional parameters required.

Checkout (Optional)

A checkout flow was started.

Product IDs (Optional)
String/Array of strings/strings separated by commas
Select the GTM Variable that returns Product IDs in the current page.
Examples: ["sku1"], ["sku1", "sku2"]

Add to Wishlist (Optional)

A product was added to a wish list.

Product IDs (Optional)
String/Array of strings/strings separated by commas
Select the GTM Variable that returns Product IDs in the current page.
Examples: ["sku1"], ["sku1", "sku2"]

Remove from Wishlist (Optional)

A product was removed from the wish list.

Product IDs (Optional)
String/Array of strings/strings separated by commas
Select the GTM Variable that returns Product IDs in the current page.
Examples: ["sku1"], ["sku1", "sku2"]

πŸ“˜

Job Platforms

Job Platforms use the JavaScript API only and do NOT support GTM configuration. See the JavaScript API setup for Job Platforms implementation.

Publish your changes

After creating and verifying the tags, the changes must be submitted and then published to apply them to the live environment:

  1. Click Submit in your GTM workspace.
  2. Click Publish.
  3. Verify that your changes are live.

What's next?

After publishing your GTM configuration, validate that your pixel is firing correctly.