Shopify wont fire a customer event (for custom event pixels to meta)

Hi guys, I would really appreciate some help.

No matter what I try to set up customer events for a custom trigger on meta pixel it wont work.

In short we have sample orders and full size orders, ive set up two custom events including all the product ids.

However every time I try a test purchase it defaults to the standard partner integration and purchase - rather than the custom event “sample purchase” or full size purchase.

I have tried adding to the post script, the customer event and liquid theme. nothing works.

when attempting to manually trigger it in the console it fires in event manager on meta, but it just wont seem to automatically fire.

Maybe it’s a limitation of the integration?

here is the code for customer event.

// Subscribe to Shopify’s Checkout Completed Event
analytics.subscribe(“checkout_completed”, event => {
let orderValue = event.data.totalPrice.amount;
let currency = event.data.totalPrice.currencyCode;

// Sample Product IDs
let sampleProductIDs = [“9745311531314”, “8187445575986”];

// G Add-on (only counts if ordered with a sample)
let sampleGummiesIDs = [“9752827658546”, “9683579142450”, “8198308430130”];

let hasSample = false;
let hasG = false;

// Loop through all purchased products
event.data.products.forEach(product => {
let productID = product.id;
let productTitle = product.title;

if (sampleProductIDs.includes(productID)) {
hasSample = true;
}
if (sampleGIDs.includes(productID)) {
hasG= true;
}
});

if (hasSample) {
// Track Sample Purchase (with or without G add-on)
fbq(‘trackCustom’, ‘SamplePurchase’, {
currency: currency,
value: orderValue,
content_name: “Sample Purchase”,
content_ids: sampleProductIDs,
content_type: “product”
});
}
});

you no longer enter code. use the Meta app

https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-pixel

Thanks, but this is for custom events.

The issue is the integration isn’t firing them or finding it

are you saying setting it up though the app is not for customer events?

either way I have no doubt the code you are trying to use will never work.

You cannot set up custom events on the app

It’s one of the specified limitations of the integration.

I appreciate the feedback.

The issue I have is the code needed for a custom event

trackCustom

The app integration doesn’t support this, only the standard events

I understand what you are saying. I just don’t think you can track anything with the code any longer.

I thought there were some settings inside the app for custom events.

I remember having a similar conversation on Reddit about this. I just cannot recall the outcome. Maybe create a post over there. I would guess someone would chime in with a definitive answer.

GL! Wish I knew exactly for you!

Thank you!

Yes will do

Appreciate the help either way

Hey @carltonjroach ,

If you haven’t found a solution just to let you know this IS possible, the example in Create a custom pixel code covers you’re target use case.

https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/code#custom-pixel-example

LMK if you have any questions