We are using custom pixel tracking code for Purchase confirmation event. Is there any object or variable available for Order Revenue and Customer Name in Funnelish to send the data to Purchase confirmation.
Below one is the example custom Purchase Confirmation code.
Thank you for your question! In Funnelish, you can pass the order revenue and customer name to custom pixel tracking for Purchase Confirmation events. We have variables available for these purposes.
Here’s an example to get you started:
window.Funnelish.on('purchase-confirmation', function(data) {
const orderRevenue = data.order.revenue; // retrieves the order revenue
const customerName = data.customer.name; // retrieves the customer name
// Example custom pixel code
fbq('track', 'Purchase', {
value: orderRevenue,
currency: 'USD',
name: customerName
});
});
In the code snippet above:
data.order.revenue will capture the order revenue,
data.customer.name will capture the customer’s name.
Feel free to adjust the code according to your tracking pixel’s requirements. For more details on setting up Facebook Pixel tracking, please refer to our documentation here.
Normally, my pixel code will work on the page load. But in the given window.Funnelish.on(‘purchase-confirmation’, function(data) event code is not running.
Also, I am getting this error on console Uncaught TypeError: Cannot read properties of undefined (reading ‘on’)