Skip to main content

Pixel Configuration through Google Tag Manager (LB 2.0)

Written by Marija Golubovic

Overview

This article explains how to add Meta, TikTok, and Snapchat tracking through Google Tag Manager (GTM) for the Lunchbox web ordering site. GTM is the one place where all ad tracking lives. Tracking through GTM applies to the web ordering site only, not the mobile apps.

Prerequisites

  • The restaurant’s GTM container ID must be saved in the Lunchbox Admin Dashboard under Design > Web > Tracking Ids.

  • Each pixel must be set up in one place only. If the pixel code was also added directly to the site or to another tool, remove that copy.

  • The Tracking IDs screen also has a Meta Pixel Identifier field. If the restaurant’s Meta pixel is saved there and the restaurant now adds Meta in GTM, clear that field. If Meta runs in both places, every order is counted twice, so we need to avoid that scenario.

Setup in Google Tag Manager

The restaurant’s team completes the setup in its own GTM container, in this order:

  1. Create the variables (Step 1).

  2. Create the triggers (Step 2).

  3. Add the template for each platform the restaurant uses (Step 3).

  4. Add the tags for each platform (Step 4).

  5. Test and publish (Step 5).

Steps 1 to 3 are done once and are shared by all platforms.

Step 1: Tell GTM where to find the order number

  1. In the GTM workspace, go to Variables. Under User-Defined Variables, click New
    ​

  2. Click Variable Configuration and choose Data Layer Variable.
    ​

  3. In Data Layer Variable Name, enter ecommerce.transaction_id. Leave Data Layer Version on Version 2.

  4. Name it DLV - ecommerce.transaction_id and click Save.
    ​

  5. For TikTok and Snapchat, repeat steps 1 to 4 for ecommerce.value (name it DLV - ecommerce.value) and ecommerce.currency (name it DLV - ecommerce.currency). Meta doesn't need these.

This is how User-Defined Variable looks after saving

Step 2: Tell GTM when to send the order details

  1. Go to Triggers and click New.
    ​

  2. Click Trigger Configuration and choose Custom Event.

  3. In Event name, enter purchase. Leave it on All Custom Events. Click Save.
    ​

  4. In the Rename Trigger window, enter Event - purchase and click Save
    ​


    ​

💡The event names must match exactly: all lowercase

Step 3: Add the pixel templates

  1. Go to Templates. Under Tag Templates, click Search Gallery.

  2. Search for the platform’s template, open it, and click Add to workspace.

  3. Repeat steps 1 and 2 for each platform the restaurant uses.

Platform

Template name

Published by

Meta

Meta Pixel

facebook

TikTok

TikTok Pixel

TikTok

Snapchat

Snap Pixel

Snapchat

Here's the Tag Template library with all three templates

Step 4: Add the tags

Add the tags for each platform the restaurant uses. Each platform needs 2 tags: a page view tag and a purchase tag. The settings for each platform are in Meta tags, TikTok tags, and Snapchat tags at the end of this article.

Step 5: Test, then publish

  1. Click Preview, enter the ordering site address, and place a test order.

  2. In Tag Assistant, check that each page view tag fired on every page and each purchase tag fired once on the purchase.

  3. Check the same events in each platform's test tools:

    • For Meta, use Meta Pixel Helper and Test Events in Meta Events Manager.

    • For TikTok, use TikTok Pixel Helper and Test Events in TikTok Events Manager.

    • For Snapchat, use Snap Pixel Helper and Test Events in Snapchat Events Manager.

  4. In GTM, click Submit, enter a version name, and click Publish.

💡Nothing fires until the tags are published.


Meta tags

Follow these steps to add the Meta page view tag and purchase tag.

  1. Go to Tags and click New

  2. Click Tag Configuration. Under Gallery, click Meta Pixel. The ADDED label next to the template means it was added to the workspace in Step 3 (above)

  3. Fill in the settings from the table below

  4. Click Triggering and choose the trigger from the table below.

  5. Name the tag and click Save.

  6. Repeat steps 1 to 5 for the second tag.

Meta tag settings

Setting

Page view tag

Purchase tag

Facebook Pixel ID(s)

Restaurant’s Meta Pixel ID

Restaurant’s Meta Pixel ID

Enhanced Ecommerce dataLayer Integration

Unchecked

Unchecked

Use GA4 dataLayer Integration

Checked

Checked

Event Name

Standard > PageView

Standard > Purchase

Consent Granted (GDPR)

True

True

Enable Advanced Matching

Unchecked

Unchecked

Object Properties

False, no properties added

False, no properties added

More Settings > Event ID

Leave blank

DLV - ecommerce.transaction_id

Triggering

Initialization - All Pages

Event - purchase

To choose a variable, click the brick icon next to the field.

The Event ID on the purchase tag lets Meta count each order only once.

Leave all other settings as they are. Two settings are optional:

  • Opt in to a Meta-enabled Conversions API integration is a terms agreement with Meta and is checked by default. The restaurant decides whether to keep it.

  • Limited Data Use (LDU) stays unchecked unless legal asks for it.


TikTok tags

Page view tag (pending confirmation)

  1. Go to Tags and click New.

  2. Click Tag Configuration. Under Gallery, click TikTok Pixel.

  3. In Pixel ID, enter the restaurant's TikTok Pixel ID.

  4. In Event Name, choose Page View. (pending confirmation: the Event Name list has no Page View option)

  5. Click Triggering and choose Initialization - All Pages.

  6. Name the tag and click Save.

Purchase tag

  1. Go to Tags and click New.

  2. Click Tag Configuration. Under Gallery, click TikTok Pixel.

  3. In Pixel ID, enter the restaurant's TikTok Pixel ID. It's in TikTok Ads Manager, under Events Manager.

  4. In Event Name, choose CompletePayment. This is TikTok's name for a paid order. Don't choose a variable from this list. This field is only for the event name.

  5. Under Properties, keep Use Google Analytics E-commerce Data Layers (Recommended) checked. In Currency, choose DLV - ecommerce.currency. (pending confirmation: Paul said the order value also goes here, but the template has no Value field)

  6. Under De-duplication Configurations, in Event ID, choose DLV - ecommerce.transaction_id.

  7. Leave Additional Properties empty.

  8. Click Triggering and choose Event - purchase.

  9. Name the tag and click Save.

To choose a variable, click the brick icon next to the field. Leave all other settings as they are.
​


Snapchat tags

Page view tag

  1. Go to Tags and click New.

  2. Click Tag Configuration. Under Gallery, click Snap Pixel.

  3. In Pixel ID, enter the restaurant's Snap Pixel ID. It's in Snapchat Ads Manager, under Events Manager.

  4. In Event Type, keep Page View. It's selected by default.

  5. Leave all user fields blank, such as User Email, User Phone Number, and User First Name.

  6. Click Triggering and choose All Pages.

  7. Name the tag and click Save.

Purchase tag

  1. Go to Tags and click New.

  2. Click Tag Configuration. Under Gallery, click Snap Pixel.

  3. In Pixel ID, enter the restaurant's Snap Pixel ID.

  4. In Event Type, choose Purchase.

  5. In Price, click the brick icon and choose DLV - ecommerce.value.

  6. In Currency, click the brick icon and choose DLV - ecommerce.currency.

  7. In Transaction ID, click the brick icon and choose DLV - ecommerce.transaction_id.

  8. Leave all other fields blank.

  9. Click Triggering and choose Event - purchase.

  10. Name the tag and click Save.

Did this answer your question?