{"id":4318,"date":"2020-05-26T11:57:57","date_gmt":"2020-05-26T11:57:57","guid":{"rendered":"https:\/\/trackingchef.com\/?p=4318"},"modified":"2020-05-26T13:55:14","modified_gmt":"2020-05-26T13:55:14","slug":"managing-multiple-facebook-pixels-on-one-site","status":"publish","type":"post","link":"https:\/\/trackingchef.com\/facebook\/managing-multiple-facebook-pixels-on-one-site\/","title":{"rendered":"Managing multiple Facebook Pixels on one site"},"content":{"rendered":"\n

Properly setting up your Facebook Pixel is one of the most important tasks when advertising on Facebook. The pixel helps in measurement and optimizing your campaigns, as well as enabling Facebook to create highly relevant audiences for the business.<\/p>\n\n\n\n

In most cases, setting up the pixel is straightforward (see the guide here<\/a>) and you will only need to add relevant conversion actions along your funnel. But in some cases, advertisers might need to implement multiple pixels, which require a different setup.<\/p>\n\n\n\n

Pro tip:<\/strong>
If you’re using Google Tag Manager with the Custom Template Tag for Facebook (by Simo Ahava), you’re in the clear<\/p><\/blockquote>\n\n\n\n

Who would need multiple pixels<\/h2>\n\n\n\n

A classic example for this can be a publisher that works with multiple advertisers. For example, a publisher in the field of Higher Education might want to give pixel access to a section of his site. So “Economics studies” section will have pixels for the publisher’s pixel Advertiser A, while the “Social studies” section might have pixels for the publisher and Advertiser B.<\/p>\n\n\n\n

Another example can be with a large brand that works with multiple agencies, each requiring to fire different pixel on various sections of the site.<\/p>\n\n\n\n

Both examples are from actual clients I’ve worked with.<\/p>\n\n\n\n

The issue with multiple pixels<\/h2>\n\n\n\n

If all pixels on the site are tracking the same behaviors, then there’s no problem at all. But if some actions should be restricted only to some pixels, it can get messy.<\/p>\n\n\n\n

Let’s understand why.<\/p>\n\n\n\n

Say Agency A want to track a conversion with a Lead event, while Agency B wants to use a Custom Event called Step4.<\/p>\n\n\n\n

The standard pixel setup would look something like this:<\/p>\n\n\n\n

Agency A<\/strong><\/p>\n\n\n\n

<script>\n...base code...\n  fbq('init', '1234567890');\n  fbq('track', 'Lead');\n<\/script><\/code><\/pre>\n\n\n\n

Agency B<\/strong><\/p>\n\n\n\n

<script>\n...base code...\n  fbq('init', '9876543210');\n  fbq('trackCustom', 'Step4');\n<\/script><\/code><\/pre>\n\n\n\n

Loading these two scripts one after the other will result in the following events being triggered:<\/p>\n\n\n\n

<\/div>\n\n\n\n
Pixel<\/th>PageView<\/strong><\/th>Lead<\/th>Step4<\/th><\/tr><\/thead>
Agency A (1234567890)<\/em><\/td>\ud83d\uddf8<\/td>\ud83d\uddf8<\/td>\ud83d\uddf8<\/td><\/tr>
Agency B (9876543210)<\/em><\/td>\ud83d\uddf8<\/td><\/td>\ud83d\uddf8<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n
<\/div>\n\n\n\n

The Step4 event will trigger twice, firing on both pixels.<\/strong><\/p>\n\n\n\n

This is due to the fact that both pixels that loaded on the page will respond to the fbq(‘track’) function, so the data will be sent to both.<\/p>\n\n\n\n

Sending data only to a specific pixel<\/h2>\n\n\n\n

The solution, introduced by Facebook<\/a> in November 2017, is to instruct the fbq() function to only trigger a certain pixel ID for the specific action.<\/p>\n\n\n\n

This new method, trackSingle <\/em>and trackSingleCustom<\/em>, works just like the standard track <\/em>and trackCustom <\/em>fbq() methods, but also takes a parameter for the pixel ID.<\/p>\n\n\n\n

For example, a PageView tag in the new method will add the pixel ID right before the action.<\/p>\n\n\n\n

fbq('trackSingle', '1234567890', 'PageView');<\/code><\/pre>\n\n\n\n

Going back to the previous example, with a simple update to the code, we can make sure that the right action is sent to the right pixel.<\/p>\n\n\n\n

Agency A<\/strong><\/p>\n\n\n\n

<script>\n...base code...\n  fbq('init', '1234567890');\n  fbq('trackSingle', '1234567890', 'Lead');\n<\/script><\/code><\/pre>\n\n\n\n

Agency B<\/strong><\/p>\n\n\n\n

<script>\n...base code...\n  fbq('init', '9876543210');\n  fbq('trackSingleCustom', '9876543210', 'Step4');\n<\/script><\/code><\/pre>\n\n\n\n
<\/div>\n\n\n\n
Pixel<\/th>PageView<\/th>Lead<\/th>Step4<\/th><\/tr><\/thead>
Agency A (1234567890)<\/em><\/td>\ud83d\uddf8<\/td>\ud83d\uddf8<\/td><\/td><\/tr>
Agency B (9876543210)<\/em><\/td>\ud83d\uddf8<\/td><\/td>\ud83d\uddf8<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n
<\/div>\n\n\n\n

The Step4 event will trigger once, only for the pixel defined.<\/strong><\/p>\n\n\n","protected":false},"excerpt":{"rendered":"

Properly setting up your Facebook Pixel is one of the most important tasks when advertising on Facebook. The pixel helps in measurement and optimizing your campaigns, as well as enabling Facebook to create highly relevant audiences for the business. In most cases, setting up the pixel is straightforward (see the guide here) and you will […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/4318"}],"collection":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/comments?post=4318"}],"version-history":[{"count":9,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/4318\/revisions"}],"predecessor-version":[{"id":4329,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/4318\/revisions\/4329"}],"wp:attachment":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/media?parent=4318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/categories?post=4318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/tags?post=4318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}