I would like to include both my Facebook Pixel id and customer\'s Facebook Pixel id in one page, so both of us can have some insight about users, and customer can also creat
I had the same requirement and I found that it is possible and you don't need to hack the Facebook pixel code.
Even if it is not documented, the fbq
object support multiple pixel ids.
Just call multiple times the init
function with different pixel ids. Then, then when you do fbq('track', "PageView");
it will issue one event per pixel. You can call fbq('track', '{{your_event_name}}')
as many times as you want and it will track the event for all previously initialized pixels.
So your final code would look like this:
Edited April 2019 @chuck-le-butt found that a blog post from facebook document how to use the pixel: https://developers.facebook.com/ads/blog/post/2017/11/28/event-tracking-with-multiple-pixels-tracksingle/