Home › How-tos › The Secret Setups › Meta
How to send Meta Pixel events through Google Tag Manager
Live guide · Checked 28 October 2026 · Updated 28 October 2026 · Checked every week against Meta's own help pages
Load the Meta Pixel once, send Lead and Purchase from your dataLayer with an event ID, and have it ready for the Conversions API to match.
- Time
- 25 minutes
- You will need
- Your Meta Pixel ID (Events Manager > Data sources)
- Google Tag Manager with the generate_lead trigger
- Consent Mode set up (Meta waits for Accept)
- Stuck?
- Troubleshooting or ask us a question
Step by step
Find your Pixel ID
In Meta Events Manager, open Data sources, pick your pixel and copy its ID (a long number).
Add the base pixel
In Tag Manager: Tags > New > Custom HTML. Paste this with your ID, fire it on All Pages, and in Advanced Settings > Consent Settings require
ad_storage:<script> !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js'); fbq('init', 'YOUR_PIXEL_ID'); fbq('track', 'PageView'); </script>Send Lead from the dataLayer
Make another Custom HTML tag fired on
CE - generate_lead. The eventID is your lead_id, which is how Meta matches this with the server copy:<script> fbq('track', 'Lead', { value: {{DLV - value}}, currency: '{{DLV - currency}}', content_name: '{{DLV - form_id}}' }, { eventID: '{{DLV - lead_id}}' }); </script>Fire the base pixel first
In the Lead tag open Advanced Settings > Tag Sequencing, tick Fire a tag before and choose the base pixel tag, so
fbqalways exists.Purchase for shops
For purchases, fire on the
purchaseevent with the order id as eventID:<script> fbq('track', 'Purchase', { value: {{DLV - ecommerce.value}}, currency: '{{DLV - ecommerce.currency}}', content_type: 'product' }, { eventID: '{{DLV - ecommerce.transaction_id}}' }); </script>Test with Test Events
In Events Manager open your pixel > Test events, enter your site's address and send a test lead. Lead should appear with an Event ID. Install the Meta Pixel Helper browser extension for a second check.
Publish
Publish in Tag Manager. Add the Conversions API next (the next Secret Setup) so Meta still sees leads that ad blockers and iPhones hide.
Tips from people who set these up every week
- Don't also install the pixel through a plugin or your site builder: two pixels double count everything.
- Lead is the right standard event for form fills; use Contact for calls and emails if you want them separate.
Troubleshooting: questions and answers
Pixel Helper shows the pixel twice.
Another pixel is installed elsewhere (a plugin, Shopify's Meta app, the site builder). Remove one.
Lead doesn't fire before Accept.
That's correct: it waits for consent. Click Accept on your banner and test again.
Official help pages
Let Claude fix the rest of your funnel
Lead Focus is 12 Claude Skills that find the stage of your funnel that's costing you leads, then fix it: ads, landing pages, follow-ups and tracking. One payment, 12 months of updates, and a 14-day refund.
Get Lead Focus · $29.99Still stuck, or have a question?
Tell us where you got to and what you see. We read every message and reply by email, usually the same working day.