Chord CDP
...
CDP Destination Catalog
Facebook Pixel
15 min
introduction facebook pixel is a piece of code you add to your website to track visitor actions, such as page views, purchases, or sign ups it helps advertisers measure the effectiveness of facebook ads, optimize campaigns based on user behavior, and retarget visitors with personalized ads across facebook and instagram getting started this is a device mode destination you will need the facebook pixel id to connect this destination you can locate the facebook pixel id from the snippet created on the https //www facebook com/ads/manager/pixel/facebook pixel/ connecting to the facebook pixel cdp destination before connecting destinations in the chord cdp, please verify with all destination owners that all non chord cdp configured destinations are disabled running external destinations alongside configured chord cdp destinations can result in duplicate events downstream log into the chord data platform navigate to the cdp click the "add" button next to destinations select facebook pixel from the destination catalog enter in the destination name and the facebook pixel id click "create" to connect events event mapping chord event facebook event page pageview checkout started initiatecheckout order completed purchase product added addtocart product viewed viewcontent subscription created subscribe all facebook pixel events include these common options option chord source (in priority order) notes eventid messageid used for event deduplication external id userid > anonymousid omitted if neither is present events page fires a facebook page view event facebook sdk call fbq("track", "pageview", {}, eventoptions) no additional attributes are sent with page events track track events use fbq("tracksingle", pixelid, ) to ensure the event is only sent to the configured pixel (not other pixels that may be on the page) checkout started fires an initiate checkout event with order and product data facebook sdk call fbq("tracksingle", pixelid, "initiatecheckout", orderdata, eventoptions) facebook attribute chord source (in priority order) notes content ids each product's sku > product id > id (or configured productcontentidfield ) array of all product ids content type (hardcoded) "product" content category first product's category contents array of { id, quantity, item price } per product id uses sku > product id > id ; quantity defaults to 1 currency order currency value order total > order value formatted to 2 decimal places; defaults to "0 00" num items count of content ids returns empty object if order products is empty order completed fires a purchase conversion event with order and product data facebook sdk call fbq("tracksingle", pixelid, "purchase", orderdata, eventoptions) same attributes as checkout started above product added fires an add to cart event using the first product from order products facebook sdk call fbq("tracksingle", pixelid, "addtocart", productdata, eventoptions) facebook attribute chord source (in priority order) notes content ids product sku > product product id > product id (or configured productcontentidfield ) single value (not array) content type (hardcoded) "product" content name product name content category product category currency order currency value product price formatted to 2 decimal places; defaults to "0 00" contents \[{ id, quantity, item price }] single element array; quantity defaults to 1 returns empty object if order products is empty product viewed fires a content view event using the first product from order products facebook sdk call fbq("tracksingle", pixelid, "viewcontent", productdata, eventoptions) same attributes as product added above subscription created fires a subscribe event with order and product data facebook sdk call fbq("tracksingle", pixelid, "subscribe", orderdata, eventoptions) same attributes as checkout started above all other track events and identify events are silently skipped initialization the plugin sets up the fbq function queue (with disablepushstate true to prevent automatic pageview tracking and allowduplicatepageviews true ), then loads https //connect facebook net/en us/fbevents js after the script loads, it calls fbq("init", pixelid) optionally with { external id } if a userid or anonymousid is available on the triggering event the plugin manages sdk loading state ( fresh → loading → loaded / failed ) to prevent duplicate script loads concurrent events during loading are queued via a shared initialization promise if the script fails to load, subsequent events are silently dropped csp requirements if your site uses a content security policy, allow the following domains directive domain script src https //connect facebook net connect src https //connect facebook net