Integrate Facebook Pixel into Google Tag Manager
When managing Facebook campaigns, being able to measure what users do on your website is key — knowing if they fill out a form, search for an accommodation, or complete a booking helps you make better decisions. With Google Tag Manager (GTM), you can integrate Facebook Pixel quickly without editing your site’s code every time you make a change. This gives you more control, speed, and peace of mind.
What is Facebook Pixel and what is it used for?
The Facebook Pixel is a snippet of code that collects information about visitor activity on your website. With it, you can:
Measure conversions from your Facebook and Instagram ads.
Create custom audiences based on user actions.
Optimize advertising campaigns with real data.
Integrating it through Google Tag Manager lets you manage everything from one place and avoid errors caused by editing the source code directly.
Step-by-step: How to integrate Facebook Pixel in GTM
1. Create the User Tracking Tag
To track user activity on your website through Facebook Pixel, you need to add a tag that tracks all pages, just like in Google Analytics.
Log in to your Google Tag Manager account.
Create a new tag and set the Tag Type to Custom HTML.
Paste the Pixel code provided by Facebook.
2. Configure standard events
Facebook offers predefined events (such as search, registration, or purchase). To add them in GTM:
Create a new tag with Custom HTML as the type.
Paste the script for the event you want to track.
Some examples:
formContact, formContactAccomodation, formOwners
<script> fbq('track', 'Contact');</script>
formNewsletter, formNewsletterFooter
<script> fbq('track', 'CompleteRegistration');</script>
formSearch
<script> fbq('track', 'Search');</script>
viewContent
<script> fbq('track', 'ViewContent');</script>
initiateCheckout
<script> fbq('track', 'InitiateCheckout');</script>
confirmBookingAccomodation*
<script> fbq('track', 'Purchase', {value: ##{{value}}, currency: ##{{currency}}});</script>
* As you can see, this last one is slightly different — the value and currency data are added between the ##{{}}
symbols because they’re variables retrieved by GTM, previously configured in your setup.
In Advanced Settings, go to Tag Sequencing and select the option Fire a tag before this tag fires. Choose as the configuration tag the Facebook Pixel tag you created for user tracking (in the example, it’s called General Tracking FBPixel).
Then, add the corresponding trigger.
3. Publish changes
Once all events are registered, your configuration should look similar to this:
After reviewing everything, publish the container — from that moment on, Facebook will start receiving event and tracking data from your website.
Best practices
Test before publishing: Use GTM’s Preview Mode and Facebook’s Event Tester tool.
Centralize management: Avoid duplicating scripts in your site’s source code and in GTM to prevent inflated data.
Quick checklist
✅ Did you create the Facebook Pixel tracking tag with an “All Pages” trigger?
✅ Did you add all the key events for your business?
✅ Did you configure tag sequencing correctly?
✅ Did you test everything in Preview Mode before publishing?
Common mistakes
Forgetting tag sequencing: Without this step, events may fire before the Pixel is ready.
Not including value and currency variables in purchases: This causes conversions to appear incomplete in Facebook.
Publishing without testing: Always validate your setup using diagnostic tools first.
Frequently Asked Questions
Do I need programming knowledge to set up the Pixel in GTM?
No. Copying and pasting the code snippets provided by Facebook and assigning triggers in GTM is enough.
Which events should I configure first?
Start with the most important for your business: page view, contact, registration, and purchase. Then add more specific ones.
What happens if I don’t set up tag sequencing?
Your events might not be recorded properly, as they could fire before the Pixel is loaded.
Can I use the same Pixel on multiple websites?
Yes, but ideally, use one Pixel per domain to keep your data organized.
How can I verify that the events work?
Use the Meta Pixel Helper Chrome extension or the Facebook Diagnostics Panel.
In summary
Integrating Facebook Pixel in Google Tag Manager gives you a clear view of what happens on your website and enhances your campaign performance.
Set up the general tag, add your key events, test everything before publishing, and start making data-driven decisions.