Ecommerce Shopify WordPress Discussion

Custom Events for custom pixel

I was using old pixel code which you have to put in checkout setting for pixel code, but now I am trying to implement custom events. Everything is working fine but I am not receiving checkout_id through analytics.subscribe('checkout_completed', (event) => { // Example for accessing event data const checkout =; const checkoutTotalPrice = checkout.totalPrice.amount; const allDiscountCodes = => { if (discount.type === 'DISCOUNT_CODE') { return discount.title; } }); const firstItem = checkout.lineItems[0]; const firstItemDiscountedValue = firstItem.discountAllocations[0].amount; const customItemPayload = { quantity: firstItem.quantity, title: firstItem.title, discount: firstItemDiscountedValue, }; const paymentTransactions = => { return { paymentGateway: transaction.gateway, amount: transaction.amount, }; }); const payload = { event_name:, event_data: { totalPrice: checkoutTotalPrice, discountCodesUsed: allDiscountCodes, firstItem: customItemPayload, paymentTransactions: paymentTransactions, }, }; // Example for sending event data to third party servers fetch('', { method: 'POST', body: JSON.stringify(payload), keepalive: true, }); }); and why is an empty array? I need checkout_id for my attribution and gift_card amount and attribute array
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.