How to Set Up Meta Pixel via GTM
In GTM, create a Custom HTML tag with the Meta Pixel base code (including your Pixel ID), trigger on All Pages. For events, create separate Custom HTML tags for each event (Lead, Purchase, AddToCart, ViewContent) with the fbq('track', 'EventName') code, triggered by appropriate GTM triggers. This ke
Quick Summary
In GTM, create a Custom HTML tag with the Meta Pixel base code (including your Pixel ID), trigger on All Pages. For events, create separate Custom HTML tags for each event (Lead, Purchase, AddToCart, ViewContent) with the fbq('track', 'EventName') code, triggered by appropriate GTM triggers. This keeps all pixel management in GTM without touching your site code. Test each event in GTM Preview Mode and verify in Meta's Events Manager Test Events tool.
Overview
In GTM, create a Custom HTML tag with the Meta Pixel base code (including your Pixel ID), trigger on All Pages. For events, create separate Custom HTML tags for each event (Lead, Purchase, AddToCart, ViewContent) with the fbq('track', 'EventName') code, triggered by appropriate GTM triggers. This keeps all pixel management in GTM without touching your site code. Test each event in GTM Preview Mode and verify in Meta's Events Manager Test Events tool.
Related Guides
See our complete guide library for detailed coverage of setup, tracking, analysis, and optimisation across all platforms.
Process Flow
Interactive diagram — drag to pan, scroll to zoom
Step-by-Step Guide
Follow these 3 steps to complete this guide
Step-by-Step Setup
Best Practices
Common Issues and Solutions
Frequently Asked Questions
Common questions about this topic
Was this guide helpful?
Your feedback helps us improve our guides