Facebook Pixel buggy?

Hi everyone, I’m experiencing a bug/issue with Facebook Pixel in my landing page
I have set up basic facebook pixel in the main landing page, and it works good: it tracks page views.
Then I have set up an event in the form confirmation dialog. According to Facebook, I have to put the event just right after the main pixel code but I cant’ do this , the only thing I can do is putting the event code “After Body Tag” ; it’s not working
Tthe only way I have found to make it work is adding the main facebook pixel in the confirmation dialog too (Head) + adding a new script with the event (after body tag). This way I can track the event but I get 2 pageviews, baiscally the page view is counted twice by the pixel (and it makes sense, has the basic code is installed twice)

How can I fix it? Has anyone ever experienced this before? It’s kinda annoying as Facebook custom events are very important and if the page view fires up twice… analytics will be messed up

Hi Alessio,

Welcome to the community!

You should be able to remove the fbq(‘track’, “PageView”); from the code in your Form Confirmation Dialogue script. Removing this line in the script on the FCD should allow your custom event to fire without tracking a second pageview.

Here is a good article that will walk you through the whole process.

1 Like

Hi Benjammi, thanks for your help

I think there is a lot of confusion about this topic here in Unbounce community (also support is not doing great)
Facebook is pretty easy when it comes to guidelines:

  • put base code in Head section
  • put the event code just after the body tag

That’s it. I have tried what you suggested but it’s still not working.
I have tried:

  • base code in Head section of confirmation dialog removing the line about page view
  • event code (in a separate script) after body tag

not working… I don’t undertand why it’s so hard to make it work, it’s not supposed to be like that

1 Like

I have managed to make it work, still it’s weird

  • Do not use Script Manager at domain level, instead use the in-page script manager
  • put the base pixel code in main landing page, head section
  • put the base pixel code without the pageview line + the event code in confirmation dialog, head section

it’s very weird because the Script Manager at domain level is meant to work… also the event code shouldn’t go in Head section, it should go after body tag

Anyway, this way it seems to work. Hope the Unbounce support will see this topic and fix it

Thank you