Facebook Ads is an incredibly popular platform for running advertising campaigns, but in order to get the most out of it you’ll need to make sure that the Facebook ‘pixel’ is implemented on your website. This is where Google Tag Manager comes in as it’s easier to implement the pixel through this as opposed to via the website’s code itself (which can be challenging and may require a developer).
To add the Facebook pixel using GTM, follow these simple steps.
Create a New Custom HTML Tag
Start by logging in to your Google Tag Manager account and going to the specific container you want to use.
Click ‘New’ to start creating a new tag.
Give your tag a name. Let’s go crazy and call it “Facebook Pixel”.
Bring up the list of tag types by clicking the Tag Configuration area. From this list, choose Custom HTML which is under the Custom section, just below Featured.
Get the Facebook Pixel Code Snippet
We’ve now got an empty HTML field where we can place the Facebook pixel code.
To get the code, load up Facebook Business / Ads Manager for the relevant account, and from the menu at the top left select Events Manager (see screenshot below).
Assuming you’ve already set your pixel up in Facebook, you should see it listed there on the Data sources page.
If the green Set up pixel button is showing, click that. Otherwise, click the Details button on the right of your pixel to go to the pixel Overview page. Once there, either click the green Set up Pixel button in the middle or click the Set Up drop-down at the top-right of the screen and choose Install Pixel.
Whichever one you choose, you’ll be given some options as to how you want to install the pixel. You want to choose Manually add pixel code to website.
You should now see the pixel code. The way it’s presented may differ depending on the option you chose previously (Set up Pixel vs Install Pixel), but the code itself is exactly the same.
Copy the code to your clipboard and we’re ready to move on to the next step. We don’t need to setup any Events for now.
Finish Creating the Tag
Go back to Google Tag Manager and paste the pixel code that we just copied into the HTML field.
Expand the Advanced settings section just below the field and for the Tag firing options drop-down select Once per page.
The final step is to make sure that the tag fires on every page, so scroll down to the Triggering section below Tag Configuration and from the list of trigger choose All Pages.
Finally, click the blue Save button to save your new Facebook pixel tag and then Submit and Publish your container to get the updates live.
Check Your Facebook Pixel is Working
As always, it’s worth double-checking that everything is working correctly.
We’re going to want to check that Facebook is receiving data from the new pixel on your website, so first of all visit your website and click around to generate some activity.
Go back to the Facebook Events Manager screen that we got our pixel code from and you should see the Status icon now turn green and show “Active” (rather than it being grey and showing “Inactive”), along with when it last received data (which should be very recently). If that’s the case, well done – success!
If you can’t see any activity through Facebook Ads Manager, there are a couple of other things to look at that might help diagnose the problem:
- Install the Facebook Pixel Helper extension for Google Chrome, load up your website (you may need to refresh) and check the activity that the extension is seeing by clicking on the icon.
- If that’s inconclusive or not showing anything, try the Preview Mode in Google Tag Manager to see whether the tag is even firing.
You should now have the Facebook pixel installed on your website and it’s receiving user activity that can feed into your advertising campaigns.
If the instructions above worked for you, or if have any questions, let me know in the comments below.