Hi, I’m hoping to get some help with dynamic retargeting ads on Facebook.
We have set up a catalogue using a data feed provided by Flexify, but the issue we’re facing now is that the Facebook pixel set up in Shopify isn’t passing content_IDs data when it fires.
After hours of searching, I can’t find any explanation as to how to set this up. Every guide I’ve found either assumes that the pixel is already sending content IDs, or gives the raw code and suggests ‘put your product ID here’, but that implies that the code has to be added manually to every single product page, which can’t be the case.
Is there a way to pass this information through automatically with the Facebook integration in Shopify?
If you are using the content_ids property in your parameter object, its value should correspond to the product ID or product IDs associated with the action. IDs must match the IDs found in your product catalog. Values can be either single IDs, or an array of IDs.
For example, here’s how to track a visitor who has added products with the IDs 201 and 301 to a shopping cart. The IDs match the IDs for those products in the product catalog.
fbq('track', 'AddToCart',
// begin required parameter object
{
value: .5,
currency: 'USD',
content_type: 'product', // required property
content_ids: ['201', '301'] // required property, if not using 'contents' property
}
// end required parameter object
);
Thanks for your response! I understand that the product IDs need to be sent via the pixel and must match the content_IDs in Facebook, and I’ve seen the Facebook support page you linked.
These instructions make it sound as though I need to manually input those product IDs, one by one, into the pixel code onto every single unique product page. We have over 400 products, so what I’m hoping for is that there’s a way to do this automatically at scale. Is that possible?
Just wanted to follow this one up and try to explain the issue again in case it’s not clear. We’ve added the Facebook pixel to the account using the Facebook app in Shopify.
When a user initiates checkout, the custom parameters are set up automatically to send the product IDs to Facebook using the pixel as content_ids - see below:
I’m hoping that there is an easy way to set up the View content event on the product pages so that the content ids are sent automatically when someone views products but doesn’t initiate checkout.
Don’t look at the PageView Event. That gets sent anytime the pixel is loaded. When someone views a product, the ViewContent event is what’s “special” that recognizes it as a product view, and Shopify’s native pixel event will include the content IDs in that event. I’m guessing you’re also looking at the same thing with add to carts. Look at the AddToCart event.
Hi Josh_Uebergang, yes, the issue we were having is that the Shopify native pixel event wasn’t sending the content IDs with the View Content or Add to Cart events. It was only sending them with Initiate Checkout and Purchase.
Anyway, we got a developer in who was able to set up those events manually for us.
If you use the Facebook & Instagram app on Shopify to populate the collection on Meta then the Content ID on Meta equals to the Variant ID on Shopify. You can use this value in the code dynamically.