Installing Facebook tracking pixel to measure email form submissions?

  • 29 January 2014
  • 36 replies
  • 26 views

Hello,

I’m trying to create a Facebook ad that optimizes for conversions. The conversion goal is simply submitting an email on my Unbounce landing page. My landing page is hosted on a subdomain of my website.

To create this ad, you have to create and install a tracking pixel. Facebook instructs the following: “
Copy and paste the following code between and on the page of your website you want to track actions. For example, to track registrations, place the code on your ‘registration completed’ web page.

For the landing page, this would be the “Thank You” confirmation page. Do I add the pixel there with the custom HTML tool?

Thanks!


36 replies

Hey Michael - you’ll want to place your Facebook tracking pixel on the final page of your funnel, usually this is the form confirmation dialogue in Unbounce. Drop the pixel in the JavaScript button and set the placement to “Before Body End Tag.” That should do the trick! If you have any other questions, let us know.

PS: It can take up to 48hrs for Facebook to recognize the Facebook conversion tracking pixel. So don’t sweat if it’s not immediately recognized as “active.”

Thanks for your reply.

Yes! That did work! And it did take almost exactly 48 hours. Now I can put my first landing page to work.

Thanks again.

Awesome! Glad to hear we were able to put your mind at ease!

Thanks - just an FYI but I ran into this problem as well - FB says to place the tracking code before the but it doesn’t seem to fire. I’ll try it “Before Body End Tag” and let you know what I hear back from them.

Hey David - sorry to hear you’re having some trouble. If placing the script in the “Before Body End Tag” doesn’t do the trick please let us know. We can open up a support ticket and dig in further.

The facebook instructions actually say to include it in the Head tag. Can anyone confirm if placing it in the head will work? It is currently saying ‘unverified’ but if it takes 48 hours to work I could just be seeing the delay. I would like to get know from other peoples experience if it works in the Head tag without waiting 48 hours for a confirmation.

Hey Benjamin!

Facebook asks users to place the snippet between ```

and ``` . I know that can seem confusing but in Unbounce that means “Before Body End Tag” not the “Head.” We’d recommend changing it to “Before Body End Tag,” waiting 48hrs then it should work a-ok. Hope that helps!

Hi Lou,

Please can you explain why placing the snippet between and actually means we should place the pixel “before body end tag”?

Ben,

Hey Ben - sorry if I caused more confusion!

To better explain, the majority of Unbounce’s customers have had issues placing Facebook’s tracking pixel in the “Head” of the JavaScript button. We think the problems may stem from the fact Facebook uses server side tracking. If you put the script in the head of an Unbounce page, the page doesn’t have time to finish loading before a conversion is tracked.

The good news is this is resolved in Unbounce by changing the placement to “Before Body End” tag. This way, the visual elements of the landing page can load before the code executes. Hope that helps!

I just can _t find where I should place the pixel 😦

Hi Elen,

You would place this tracking pixel in the javascripts panel, with placement set to ‘Before Body End’. For a demo of where exactly to find this, watch this quick video: http://screencast.com/t/lDfAvke8

Let me know if this helps!

This might be a dumb question…but why go through all this trouble to track email submissions? Won’t you get the emails that were submitted? Doesn’t that alone help you “track” how your email submission page is doing? What information does this pixel give you that you don’t know simply by how many email submissions you get?

Userlevel 3
Badge +1

Hi Kayla - the Facebook tracking pixel only tracks a conversion after someone has clicked through from a Facebook ad, so if you’ve got a landing page that you’re driving traffic to from multiple sources, Unbounce will count any form fill, but your Facebook Conversion Pixel would only count the conversions that are driven specifically from Facebook.

aaahhhh okay that makes a lot of sense. thanks for the concise and quick response!

Hi everyone,

I similar issues, but it actually worked when I used “head” in unbounce and not “before body end tag.”

Has unbounce made changes to this the past few months?

Userlevel 3
Badge +1

Hi there - no changes on our end. That placement drop down just puts the code in a certain location on the page.

Before, even though Facebook’s instructions said to put the code in the head, we’d see it fire intermittently instead of all the time (but it worked when it was before the end body tag, which gave time for the page to load). Facebook may have adjusted something on their end slightly, so placing it in the head’s ore reliable now.

My JS manager is saying “invalid” - ?

Userlevel 3
Badge +1

Hi Jen - it looks like you have curly quotes instead of straight quotes in parts of your code. If you change them all to straight, that should get rid of the error.

I’m actually not sure if it’s required for Javascript, but the HTML at the bottom definitely won’t render properly with the curly quotes.

awesome thank you Quinn! 🙂

I’ve followed these steps and Facebook is tracking email conversions on my campaigns; however, the number of email conversions attributed in Facebook is an order of magnitude greater than the emails counted in Unbounce.

Here’s a screencap of the javascript. Any feedback is appreciated!

Hi Sam, 

I went ahead and took a dive into your Unbounce page, and it looks like you have the conversion code on the *main page* instead of the *form confirmation dialogue*. This means that anyone who lands on the page will be counted as a conversion, which is likely not what you want to happen. I would remove the javascript from the main page and place it on the form confirmation dialogue instead. 

Awesome - thanks Justin.

I put it in the before body place,but when I tried out the fb helper tool,it said that the script is taking too long to load,and i might miss tracking many conversions this way.(EDIT:It seems to be working with the head placement though)

Hi Akshay,
Facebook asks users to place the snippet between < head\> and \</head\> . I know that can seem confusing but in Unbounce that means “Before Body End Tag” not the “Head.” We’d recommend changing it to “Before Body End Tag,” waiting 48hrs then it should work a-ok. Hope that helps!

Edit: Actually, it seems to be working in the

now, so I would advise keeping it as you have it now instead. Sorry for the confusion!

That’s good but how can I test if the conversion pixel is working? I mean, I set the code between head tag and put the pixel in the submit button. But how can I know if the pixel in the button is working?

Reply