How to pass order revenue and customer name for Custom Pixel tracking

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.

Hi @guna,

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.

Let us know if you have any other questions!

Hi @anwerashif

Thanks for your reply. On which page should i add this code, Checkout page or Thank you page?

You can add this on the Checkout page

Hi @anwerashif ,

The below event is not executing on the Checkout page as well as Thank you page.

window.Funnelish.on('purchase-confirmation', function(data) {

});

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’)

Any solution for this please?

@anwerashif Please help me on this issue.