0% found this document useful (0 votes)
114 views14 pages

Facebook Pixel Cheat Sheet For GTM Analytics Mania 3

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
114 views14 pages

Facebook Pixel Cheat Sheet For GTM Analytics Mania 3

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Meta Pixel

Cheat Sheet for


Google Tag Manager

Created by
Julius Fedorovicius
Founder of Analytics Mania
[email protected]
@fedorovicius
Before you continue
It is recommended to read this guide before you use this cheat sheet.
Otherwise, some bullet points might be too confusing. If you have any questions
about the Facebook Pixel + GTM, just post a comment under that very same
blog post.

Also, Facebook is constantly changing its interface, therefore, you might notice
some differences in this cheat sheet.

Also, in the cheat sheet, I use “Facebook Pixel” and “Meta pixel”
interchangeably.

#1. Get the Meta Pixel ID


In the top right corner of the Facebook Business Manager, click the Menu icon and
go to Events Manager.

Then go to Data Sources and choose the Pixel that you’re interested in. Copy that
ID, you’ll need it later.

2|Page
#2. Facebook Pixel Custom Tag Template
In Google Tag Manager, go to Templates > Tag Templates > Search Gallery and find
the Facebook Pixel. Add it to your workspace.

Don’t use other implementation methods Facebook offers (like direct integration
between Facebook and Google Tag Manager).
3|Page
#3. Start with the Pageview Tracking

Everything starts with the basic


implementation of the Facebook pixel. In GTM,
go to Tags > New > Facebook Pixel and enter
the following settings (if some fields are not
visible in the screenshot, I did not change
anything there) →

It is highly recommended to insert Facebook Pixel


ID in a Constant Variable and then use that
variable instead →

4|Page
And then insert that variable in all of your
Facebook Pixel tags →

Enable GTM preview and Debug mode & check whether your tag has fired.

Also, check whether the data was passed properly with the help of Facebook Pixel
Helper.

5|Page
#4. Event Tracking with Meta Pixel

There are two types of events, standard


and custom. If the interaction that you
want to track can be considered as a
Standard event (you can check it here), go
with it.
For every event you want to track, you will
need to create a new Facebook Pixel tag.
Here’s an example of a Lead event that I
would activate after someone submits a
form on my Landing Page →
The trigger of this tag very much depends
on what kind of form was submitted. You
can learn more about different form types
and their triggers here.

If you want to track a custom event (like video


play, outbound link click), enter the following
settings (feel free to use any name that makes
sense to you) →

As for the trigger for this tag, here is a guide on


video tracking with GTM.

6|Page
You can also send custom properties with an event (anything you like), for
example:

7|Page
#5. Send Additional Parameters
Standard Events also support additional parameters. Here you can find the list of all
of the ones that are currently supported. Usually, they are optional. Only in Purchase
event, two parameters are required: currency and value (order total).
Here’s a sample configuration of the Facebook tag. If you want to learn more details,
read this guide.

8|Page
#6. Other Things to Know

Automatic Data Detection


By checking Facebook Pixel Helper, you probably have noticed Microdata
Automatically Detected or Button Click Automatically Detected.

Facebook Pixel tries to capture various additional data on your page. However, I
don’t trust auto-tracking solutions because they might end up capturing a lot of
garbage data too.

That’s why I usually disable this feature. If you want to do the same, go
your Facebook Pixel tags > More Settings and tick the Disable Automatic
Configuration checkbox. Do that in all Facebook Pixel tags.

Sending Data to Multiple Pixels

If you want to set the tag to send data to multiple pixels, just enter them in the
Facebook Pixel ID(s) field, separated with comma.

9|Page
#7. Advanced Matching in Facebook Pixel
Facebook Pixel Advanced Matching gives advertisers the ability to connect their
customer data — such as email addresses, phone numbers, and other demographic
data — to their Facebook campaigns, therefore, target more precisely.
Ask a developer to push some data about the user to the Data Layer (like country,
email, gender, etc.) and then you will be able to transfer it further to Facebook.
Here’s an example of the code snippet a developer could activate before the GTM
container snippet is loaded (of course, those values should be dynamically replaced).

window.dataLayer = window.dataLayer || [];


window.dataLayer.push({
'event' : 'userData',
'userId' : '123abc',
'email' : '[email protected]',
'city' 'newyork',
'gender' : 'm',
'country' : 'us'
});

Then create Data Layer Variables for each data


point, e.g.: →

10 | P a g e
Then, eventually, set those parameters in your Facebook Pixel tags:

Reminder
If you find his cheat sheet a bit confusing and want to get more details, go and
read this guide; it explains everything is greater detail (I just did not want to
overwhelm you right now with a super long e-book).

11 | P a g e
#8. Don’t Forget to Test

Always test three things/places when it comes to Facebook Pixel:

GTM Preview and Debug mode


Verify whether your Facebook Pixel
tags fire when they are supposed to.

Meta Pixel Helper


Verify whether the events you send
show the green icon.

Test Events in the Events


Manager > Data Sources (of
Facebook Business Manager)

12 | P a g e
#9. Server-side setup (Conversions API)
If you want to make your Meta Pixel setup more precise and collect data of higher
quality, you should consider implementing a server-side solution too.
According to Meta, server-side tracking with Meta’s Conversion API can help you:
• Reduce the cost per action as a result of improved connectivity
• Improve measurement
• Reduce cost per action
• Increase data control
This is a much more advanced topic that I explain in the intermediate/advanced
Google Tag Manager course.

#10. Get Consent from Your Visitors/Users


The last but definitely not least — user privacy. All these things you can set up in
Meta Pixel with Google Tag Manager are neat, however, you cannot do that unless
you get consent from your visitors/users. There are regulations like GDPR that
protect users’ privacy and require that businesses get consent from user/visitor
before sending data to Facebook Pixel (and not limited to that).
With Google Tag Manager, you can control how your tags fire depending on
whether a visitor/user gave consent for marketing purposes.
If you want to learn how to implement a cookie consent mechanism on your site
via Google Tag Manager, you should read this guide first.
After you implement the consent mechanism, you'll end up with a bunch of
blocking triggers and consent-related variables.
Even though the Meta Pixel template has some built-in consent-related features (a
field called "Consent Granted"), it's not 100% reliable. Thus, I still prefer using
blocking triggers for Facebook/Meta tags instead.
13 | P a g e
# Final Words
This was a quick run through the key concepts of how to install Meta Pixel with
Google Tag Manager. For MUCH more information, you can head over to my
extensive blog post.

This cheat sheet was delivered to you by


Julius Fedorovicius
Founder of Analytics Mania
[email protected]
@fedorovicius

14 | P a g e

You might also like