Meta Commerce
Send purchases and storefront events to Meta through the Conversions API, work alongside the browser Meta Pixel and keep a Meta catalog in sync with the store's product feed. Settings live in Medusa Admin.
Meta Commerce
Meta Pixel, Conversions API and catalog sync for Medusa, set up in Medusa Admin.
The plugin connects a Medusa store to Meta. It sends purchases and storefront events to the Conversions API from the server, works alongside the browser Meta Pixel, and links the store's product feed to a catalog in Meta Commerce Manager. Its settings live in Medusa Admin under Settings → Integrations → Meta Commerce, through the Integration Module.
Features
- Purchases through the Conversions API – when an order is placed, the plugin sends a event to Meta from the server. The event ID is built from the order ID, so Meta can deduplicate the purchase.
- Storefront events – the storefront posts standard events (, , , , , , , ) to , and the plugin forwards them to the Conversions API with the shopper's IP address and user agent taken from the request. Any other event name is rejected, and the page address is checked against the store's storefront URLs.
- Hashed customer data – customer fields are normalized and hashed with SHA-256, as Meta requires, before they leave the server. A value that is already hashed passes through.
- Product catalog – connect a Meta catalog by its ID and register a product feed URL with it. A feed from Product Feeds keeps the catalog in sync, with the same content ID in the feed, the Pixel and the Conversions API: the SKU, or the variant ID when a variant has no SKU.
- Delivery log – every event is stored with its delivery status, , or .
- Diagnostics in Admin – the Meta Commerce page shows an overview, the events, the catalog and its registered feeds. It tests the access token against the Pixel, the catalog and the business, and sends a test event with the test event code from Meta Events Manager.
Settings in Admin
The settings page has four sections:
- Credentials – the access token of a Meta system user, stored encrypted, the Pixel (dataset) ID and the Business ID.
- Catalog – the catalog ID and the Product Feeds definition to keep in sync.
- Tracking – switches for browser Pixel events and the Conversions API, and the test event code.
- Regional / Compliance – the default currency and country of events, and the country and state codes of Meta's Data Processing Options.
Browser Pixel events need the package in the storefront.
Requirements
- Medusa 2.21 or later
- Integration Module 0.2 or later
The plugin is in beta.
Installation
Register the plugin in and add its provider, , to the providers of the Integration Module, as the Integration Module documentation shows. The plugin keeps its event log in its own table, so run the migrations:
npx medusa db:migrate
