How to install the Meta pixel and Google tag with Google Tag Manager

With Google Tag Manager, add Madder’s pixel code as a Custom HTML tag on all pages, fire Lead on a form submission or thank-you page trigger, then publish.

For Google Tag Manager. Takes about 20 minutes

On this page

Copy code in Madder’s pixel window (open it with Set up tracking) gives the block you paste below. Meta’s Meta Pixel template in the Community Template Gallery also works, with the Pixel ID from step 2 of that window; use one, never both.

Before you start#

  • The GTM container snippet on every page: in the Workspace tab click the container ID (starts with GTM-), paste the first block as high in <head> as possible and the second right after the opening <body> tag.
  • Publish rights on the container.
  • Madder’s code, and the CSS id or action URL of your lead form.

1Add Madder’s code on all pages#

Paths as of September 2026. Tags › New › Tag Configuration › Custom HTML, and paste the block from Copy code. Under Advanced Settings set Tag firing options to Once per page. Triggering › All Pages. Name it “Meta - Pixel”, Save.

2Lead on form success#

Make a second Custom HTML tag with <script>fbq('track', 'Lead');</script>, name it “Meta - Lead”, and under Advanced Settings › Tag Sequencing fire “Meta - Pixel” before it. Attach one of these triggers:

Option A, thank-you page (most reliable)
If your form redirects, create Triggers › New › Page View, fire on Some Page Views where Page Path contains /thank-you.
Option B, form submission
Go to Triggers › New › Trigger Configuration › Form Submission. Select Check Validation so the trigger fires only when the form sends, select Wait for Tags so the redirect does not cut the pixel off, and under This trigger fires on pick Some Forms with Form ID equals your form’s id. Forms that submit by JavaScript without a native submit event never fire it; push dataLayer.push({event: 'lead'}) from the form’s success callback instead and use a Custom Event trigger named lead.

3The Google tag#

Add the Google tag as a Google Tag type with the same All Pages trigger, plus a Google Ads Conversion Tracking tag on the same Lead trigger. Which IDs and which conversion action: Install the Google tag on your website.

4Preview, publish, verify#

  1. Click Preview, enter your site URL, Connect. Submit a test lead; in Tag Assistant check that “Meta - Pixel” fired on load and “Meta - Lead” fired once on success.
  2. Click Submit › Publish and Create Version, name the version, Publish.
  3. Check the live site with the Meta Pixel Helper Chrome extension: one pixel, your ID, Lead after the form.
  4. In Meta Events Manager: Data sources › your pixel › Test events, submit again and check that PageView and Lead appear.
  5. In Madder, open the pixel window again with Set up tracking. Madder checks as it opens. “The pixel is live.” means you are done. Otherwise press Check again after a minute, and if Madder still can’t see it, press Mark as installed.

If it doesn’t work#

Tags fire in Preview, nothing live
Not published; check Versions shows a Published entry.
Lead fires on every form, including search
The trigger is All Forms; add the Form ID condition.
Lead fires twice
Both Option A and Option B are attached, or the site also has a hard-coded pixel. Keep one.
Form trigger never fires
The form submits via JavaScript; use the dataLayer push, or switch to the thank-you page trigger.
Pixel Helper reports two pixel IDs
An older Custom HTML tag or a Meta Pixel template tag is still active; pause it.