"

How to install the new Facebook Pixel with Google Tag Manager

watch the updated way to install the Facebook Tracking Pixel with GTM here https://www.youtube.com/watch?v=Ri67jetlL6I

Facebook have announced that they will be changing their custom audience and conversion tracking pixel over to a new pixel that encapsulates both.
In this video, we will look at how you can install this with Google Tag Manager to track Conversion and build retargeting audiences.

https://www.facebook.com/business/hel…

Free GTM Email course: http://measursechool.com/emailcourse
Free GTM Guide: http://measureschool.com/guide

RECOMMENDED MEASURE BOOKS: https://kit.com/Measureschool/recommended-measure-books

GEAR WE USED TO PRODUCE THIS VIDEO: https://kit.com/Measureschool/measureschool-youtube-gear

SHOW MORE...

46
Leave a Comment

avatar
 
smilegrinwinkmrgreenneutraltwistedarrowshockunamusedcooleviloopsrazzrollcryeeklolmadsadexclamationquestionideahmmbegwhewchucklesillyenvyshutmouth
15 Comment threads
31 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
13 Comment authors
Liam DilleyJulianDean DutroKhristinaNathan Brunetti Recent comment authors
newest oldest
Raja
Guest
Raja

Why is facebook pixel fired on success page when you did not go to the website through facebook? We want to look at New customer acquisition through facebook, is there a way to do that? Get customer ID or something for people coming through facebook and purchasing from us so we can match that back to our database. Thanks,
Raja

Julian
Guest

The Pixel is fired on every page, but Facebook decides what should be done with the data. Since I didn’t enter the site via Fb the hit is most likely not going to count against the conversion goal. It might be used as Audience pixel.

If you want to see acquisition, you would need to be using a tool like Google Analytics incl. proper UTM tags, which I discussed two videos ago

Jim Banks
Guest

Great video Julian. I did notice though you are masking the Facebook Pixel ID in the script but not in the noscript. Might be worth adding that in as well. And the zip file is not attached to the link.

Julian
Guest

Ha, thanks for the heads up. Yea, I should have blurred this.

Nathan Brunetti
Guest
Nathan Brunetti

Hey Julian, I think this is a great video on the new FB pixel. If I wanted to track two different campaigns for two different products would I need to place two different tags with different triggers for those campaigns or just one tag with more triggers? By the way, love the new measure school interface.

Julian
Guest

thanks for your question Nathan. Only if you have different IDs for your pixel you would need to replicate the tags and triggers.

But you could also have two campaigns in Fb running and only one Pixel on your page. Fb will keep track through which campaign the user came and attribute it to the right campaign in their interface.

Nathan Brunetti
Guest
Nathan Brunetti

Great! Thanks for the clarification on this. I’m sure we will be using this in the near future.

Nathan Brunetti
Guest
Nathan Brunetti

Great! Thanks for the clarification on this. I’m sure we will be using this in the near future.

Travis Yano
Guest

Another instructive video, kudos! I’ve got a person running their site on SquareSpace…”I know…let’s not go there”…anyhoo, their contact forms are a little whacky to work with…to get the tracking for a form submissions to work I had to add a dataLayer push into the custom HTML option in the advanced form option…so, let’s say I wanted to track a form submission with the Facebook Tracking Pixel…wouldn’t I think have to essentially copy the whole tracking pixel script with the addition of “fbq(‘track’, ‘CompleteRegistration’);” into the same field and not use GTM? In other words, hard code it or is… Read more »

Julian
Guest

no, you could build a new Trigger that fires on custom Event ‘formSubmitSuccess’ and attach that to your Fb Tag.

Travis Yano
Guest

Another instructive video, kudos! I’ve got a person running their site on SquareSpace…”I know…let’s not go there”…anyhoo, their contact forms are a little whacky to work with…to get the tracking for a form submissions to work I had to add a dataLayer push into the custom HTML option in the advanced form option…so, let’s say I wanted to track a form submission with the Facebook Tracking Pixel…wouldn’t I think have to essentially copy the whole tracking pixel script with the addition of “fbq(‘track’, ‘CompleteRegistration’);” into the same field and not use GTM? In other words, hard code it or is… Read more »

Julian
Guest

no, you could build a new Trigger that fires on custom Event ‘formSubmitSuccess’ and attach that to your Fb Tag.

Julian
Guest

no, you could build a new Trigger that fires on custom Event ‘formSubmitSuccess’ and attach that to your Fb Tag.

Khristina
Guest
Khristina

Hello Julian!

I have watched your amazing video on new facebook pixel. You recommend to fire facebook conversion tag inside pageview tag.
In that case we fire 2 pageview Facebook tags. I am just wondering if it might double data in reports.
Could you clarify it?

Julian
Guest

Hi Khristina,

thanks for you question. Yes, you are right. The ‘pageview’ action would be fired twice. But since Fb is not a Web Analytics software (such as Google Analytics) the second double tracking would not skew our data. We are using Fb to build a custom Audience (Retargeting) and the double tracking would have no impact on the User being retargeted. I hope that makes sense.

The ‘purchase’ event is fired only once, so that is not double tracking.

Khristina
Guest
Khristina

Got it. That`s great! Thank you very much.

Khristina
Guest
Khristina

Got it. That`s great! Thank you very much.

Liam Dilley
Guest
Liam Dilley

I find it cleaner if you setup the facebook pixel code core and page view as its own Tag.
Then create the fbq tags as seperate tags based on different triggers and so on. To have them load after the Core tag use the Tag Sequencing to fire these AFTER the core tag has fired.

Julian
Guest

I agree. Once you get more familiar with Tag Sequencing thats the way to go

Liam Dilley
Guest
Liam Dilley

Slightly off topic Julian. The thing I find not well documented is custom values in the DataLayer. Lets say you have a CMS and it has 1 confirmation page for forms. You have your landing page and DataLayer of custom values setup with some information like persons name and email who filled in the form, the ID/name of the form that hit the landing page. Feeding that into google Analytics and showing those custom values. Or if you have added Product information to the DataLayer so if a visitor hits the page you can see the current price, name of… Read more »

Julian
Guest

no, you can only send in custom data through custom dimensions/metrics (these need to be strings) and they need to be scoped to a hit type.

GA actually prohibits you to send in any email or PII into the tool because of privacy reasons.

juliensalanave
Guest
juliensalanave

There is a typo in the URL to your facebookpixel template page in the description section and the download links don’t work on that page.

Niels
Guest
Niels

It has been a while, but thanks still! Great document!!

Julian
Guest

thanks for letting me know. I fixed it.

juliensalanave
Guest
juliensalanave

Download link for the template still broken smile

Liam Dilley
Guest
Liam Dilley

I find it cleaner if you setup the facebook pixel code core and page view as its own Tag.
Then create the fbq tags as seperate tags based on different triggers and so on. To have them load after the Core tag use the Tag Sequencing to fire these AFTER the core tag has fired.

Julian
Guest

I agree. Once you get more familiar with Tag Sequencing thats the way to go

Liam Dilley
Guest
Liam Dilley

Slightly off topic Julian. The thing I find not well documented is custom values in the DataLayer. Lets say you have a CMS and it has 1 confirmation page for forms. You have your landing page and DataLayer of custom values setup with some information like persons name and email who filled in the form, the ID/name of the form that hit the landing page. Feeding that into google Analytics and showing those custom values. Or if you have added Product information to the DataLayer so if a visitor hits the page you can see the current price, name of… Read more »

Julian
Guest

no, you can only send in custom data through custom dimensions/metrics (these need to be strings) and they need to be scoped to a hit type.

GA actually prohibits you to send in any email or PII into the tool because of privacy reasons.

Liam Dilley
Guest
Liam Dilley

I find it cleaner if you setup the facebook pixel code core and page view as its own Tag.
Then create the fbq tags as seperate tags based on different triggers and so on. To have them load after the Core tag use the Tag Sequencing to fire these AFTER the core tag has fired.

juliensalanave
Guest
juliensalanave

There is a typo in the URL to your facebookpixel template page in the description section and the download links don’t work on that page.

Julian
Guest

thanks for letting me know. I fixed it.

juliensalanave
Guest
juliensalanave

Download link for the template still broken smile

Julian
Guest

thanks for letting me know. I fixed it.

Dean Dutro
Guest

Hi Julian,

Signed up for Email course but some of the videos won’t click through.

Quick question- on the FB Guide it says to Have the Base Pixel fire After any FBQ tags. However below you state FBQ should be fired after. What do you think is the best practice?

Julian
Guest

Hey Dean,

I fixed the email course. Should be working again.

Could you point me to the FB Guide that says to fire the base Pixel after? From my understand the Base Pixel is the library. Any further function calls depend on the library being loaded. That’s why I couldn’t imagine why the base pixel would be loaded after.

Dean Dutro
Guest

Thanks Julian. Here is a screenshot from the FB Instructions out of Ad Manager. It looks like they want you to fire the base after unless I’m reading it wrong…?comment image .

Julian
Guest

yes, you are reading it wrong. this shows that the tag (the fbq tag), should fire after the Facebook Pixel Base code.

Julian
Guest

yes, you are reading it wrong. this shows that the tag (the fbq tag), should fire after the Facebook Pixel Base code.

Dean Dutro
Guest

Hi Julian,

Signed up for Email course but some of the videos won’t click through.

Quick question- on the FB Guide it says to Have the Base Pixel fire After any FBQ tags. However below you state FBQ should be fired after. What do you think is the best practice?

Julian
Guest

Hey Dean,

I fixed the email course. Should be working again.

Could you point me to the FB Guide that says to fire the base Pixel after? From my understand the Base Pixel is the library. Any further function calls depend on the library being loaded. That’s why I couldn’t imagine why the base pixel would be loaded after.

Dean Dutro
Guest

Thanks Julian. Here is a screenshot from the FB Instructions out of Ad Manager. It looks like they want you to fire the base after unless I’m reading it wrong…?comment image .

Julian
Guest

yes, you are reading it wrong. this shows that the tag (the fbq tag), should fire after the Facebook Pixel Base code.

Brian
Guest
Brian

Hi Julian, I’ve added the sourceCookie.json to my GTM instance. If I wanted to add the JavaScript function directly to the form (instead of GTM) to get the sourceCookie value and pass that through as a hidden form field, what would be the correct code syntax? I’m currently passing the GA ClientId into hidden field 1 and I’d like to add the sourceCookie value(s) to hidden field 2. Can you please share the correct javascript to get the sourceCookie value and store it into hiddenfield2? This is what I have so far: ga(function() { var clientId = ga.getAll()[0].get(‘clientId’); $(“#hiddenfield1”).val(clientId); });… Read more »

Julian
Guest

sorry, I can’t support you on this because it would entail custom coding, which takes too much time.

For your second question you might want to simply swap out #hiddenfield1 with #hiddenfield2

Niels
Guest
Niels

Hi Julian Great tutorial – the custom javascript and the general set-up works like a charm… in most cases. However I am currently running multiple A/B split test campaigns on the same page (like this: https://vwo.com/knowledge/multiple-test-on-a-page/ ), and I noticed that variations from one of the campaigns didn’t show up in GA. It turns out that the setup only passes the first of the campaign data layer variables on to the GA custom dimension. So when a visitor lands on the page where I have – in this case – four tests running it’ll show up in in GA as… Read more »

Julian
Guest

Yes, you are right. I guess you can rewrite the script, but I can’t do it off the tip of my fingers. If you figure it out, please post the answer here as it might help others.

Dean Dutro
Guest

Hi Julian,

Signed up for Email course but some of the videos won’t click through.

Quick question- on the FB Guide it says to Have the Base Pixel fire After any FBQ tags. However below you state FBQ should be fired after. What do you think is the best practice?