zsajjad / react-facebook-pixel

React JS wrapper for Facebook's Pixel
MIT License
241 stars 85 forks source link

Support for Event Tracking with Multiple Pixels #13

Closed jasondecastro closed 4 years ago

jasondecastro commented 6 years ago

The two functions: trackSingle and trackSingleCustom are spins of the existing track and trackCustom functions which allow you to specify the pixel you want to send the event to. This is helpful for when you have multiple Facebook pixels on your site that you want separate event tracking for.

Usage with this library would be simple: ReactPixel.trackSingle("Purchase", "<PIXEL_A>", {data}) ReactPixel.trackSingleCustom("Lead", "<PIXEL_B>", {data})

Some more reading directly from Facebook: https://developers.facebook.com/ads/blog/post/2017/11/28/event-tracking-with-multiple-pixels-tracksingle/

@zsajjad Any thoughts?

oojikoo commented 5 years ago

for people who may need this, Usage with this library is below.

ReactPixel.trackSingle("PIXEL_ID", "Purchase", data);
ReactPixel.trackSingleCustom("PIXEL_ID", "Custom Event", data);