Content_ids & Meta Pixel - Prioritization of SKU over Product ID?

For Workers & Pages, what is the name of the domain?

What is the issue or error you’re encountering

For the Product List Viewed event, the zaraz.ecommerce() call from our plugin provides an array of product objects to Zaraz. Each product object in this array contains both its numerical id (the Product ID) and its sku.

What steps have you taken to resolve the issue?

We are using Cloudflare Zaraz to manage our Meta Pixel (Facebook CAPI) and GA4 tracking for a WooCommerce store. E-commerce events are pushed to Zaraz via zaraz.ecommerce() by a third-party WordPress plugin (Beetle Tracking). Our Meta Catalogue feed uses the numerical WooCommerce Product ID (or Variation ID) as the primary id for items.

The issue is specific to the Product List Viewed event (e.g., on category/shop pages) sent to the Meta Pixel tool via Zaraz:
For ViewContent and AddToCart events, Zaraz correctly sends the numerical Product ID/Variation ID in the content_ids parameter to Meta. This aligns perfectly with our catalogue.

For the Product List Viewed event, the zaraz.ecommerce() call from our plugin provides an array of product objects to Zaraz. Each product object in this array contains both its numerical id (the Product ID) and its sku.
Example data for one product in the list sent to zaraz.ecommerce(): {name: “Product A”, id: 12345, sku: “SKU-ABC”, …}

If a product has no distinct SKU in WooCommerce, our plugin sends the numerical Product ID in both the id and sku fields: {name: “Product B”, id: 67890, sku: “67890”, …}
Zaraz debug logs show that when the Zaraz Meta Pixel tool processes this Product List Viewed event, it populates the content_ids (and contents..id) field for Meta Pixel using the SKU values from the incoming zaraz.ecommerce() data, not the numerical id values.
So, for the example above, Meta receives content_ids: [“SKU-ABC”, “67890”].

This behavior results in inconsistent catalogue matching for the Product List Viewed event. Products with distinct alphanumeric SKUs will not match our catalogue (which uses numerical Product IDs). Products where the SKU happens to be the numerical Product ID will match. We aim for consistent matching using the numerical Product ID across all events.

Configured the source WordPress plugin (Beetle Tracking) to prioritize “Product ID” as the identifier. This successfully fixed ViewContent and AddToCart events to use the numerical Product ID for Meta content_ids.
Extensive use of zaraz.debug() and browser console logs to verify the data structure being passed from the plugin to zaraz.ecommerce() and then from Zaraz to the Meta Pixel tool.

Confirmed that the plugin is providing both numerical id and sku for each product in the Product List Viewed zaraz.ecommerce() payload.
Confirmed our Meta catalogue feed uses the numerical Product ID as the primary identifier.

The current hypothesis is that Zaraz’s Meta Pixel tool, for list-type events, might prioritize sku over id if both are present in the data provided by zaraz.ecommerce().

What are the steps to reproduce the issue?

Set up a WooCommerce environment.
Use a plugin (or custom code) to fire zaraz.ecommerce(‘Product List Viewed’, { products: […] }) when a user views a product category or shop page.

Ensure that within the products array, each product object contains both a numerical id (Product ID) and a sku (which can be distinct or the same as the ID).
products: [{ name: “Test Product 1”, id: 101, sku: “SKU-TP1”, price: 10, category: “Test”}, { name: “Test Product 2”, id: 102, sku: “102”, price: 20, category: “Test”}]
Configure the Meta Pixel tool in Zaraz with “E-commerce tracking” enabled.

Observe the Zaraz debug output (specifically the server-side request to Facebook for the Product List Viewed event) and check the content_ids being sent. We expect it might show [“SKU-TP1”, “102”] instead of [101, 102].

Is it the expected default behavior for the Zaraz Meta Pixel tool to prioritize the sku field over the numerical id field from the zaraz.ecommerce() payload when populating content_ids for list-type events like Product List Viewed, if both fields are available?

Is there a specific configuration within the Zaraz Meta Pixel tool, or a recommended way to structure the zaraz.ecommerce({ products: […] }) call, that would instruct Zaraz to consistently use the numerical id field for content_ids for these list events (to match the behavior of ViewContent/AddToCart)?

If the default behavior cannot be changed via settings, would a custom Zaraz “Track Event” action (overriding the default e-commerce handling for Product List Viewed) be the recommended approach to manually map the numerical id to content_ids for Meta?

This topic was automatically closed after 15 days. New replies are no longer allowed.