Two Facebook pixel on one site conditional placement

Bronze Contributor
Bronze Contributor

Hi, there this is what I'm trying to do...

Please enable the Facebook Pixel on our site  For the home page, send a Facebook Pageview with the pixel ID xxxxxxxxxx On the contact us page, make sure the pixel ID is xxxxxxxxxx.  Be sure that on form submission, we send a facebook subscribe event

how do I change the pixel depending on the page?

I was told to only use one tag

when making the tag do i put one of the pixel ID above?

Sorry I'm very new to this


Two Facebook pixel on one site conditional placement

Gold Contributor
Gold Contributor

Hi Jason.

You can control the events that get sent to Facebook and trigger them off specific criteria – such as different tealium_events.

First off you’ll need to turn off the auto page view trigger – use data mappings in the tag to do this:

Screenshot 2021-10-15 at 12.46.09.png

This then allows you to use Event mapping to control what FB event you want to send, whether that be standard ones (as you’ve described with Page View and Subscribe) or custom events.

To trigger these, you use an existing data layer variable that allows you to distinguish the different events you want to trigger on. In the screengrab below, I'm using event_name for decisioning.

If you don't have one datalayer variable that could be used for all cases, make a new one, e.g. fb_event_name and set the right values to it with extensions.

In the example below, you can see a pre-existing mapping to SubmitApplication we have, and I've mocked up what a Subscribe event might look like.

Screenshot 2021-10-15 at 12.47.50.png

With this approach, pixel ID would stay the same and you would generate events only when you explicitly want to.

Hope that helps.

Head of Data Activation