Help center

Learn how to sell online with Checkout Page

Conversion (purchase) event tracking

Conversion (purchase) event tracking

You may want to track custom events or fire a script when a purchase happens, for example to track conversions. This script can help you do this when you're using the checkout embed or checkout pop-up.

Tracking conversion (purchase) events on your website

You can use the following script as a starting point. If you're not familiar with JavaScript, we recommend working with a developer to help you set up the script. We also offer paid technical support; just get in touch via the support chat.

The following script should be added to your own website, on each page where you have added your checkout and the customer will make the purchase.

<script type="text/javascript">
 window.addEventListener("message", function (event) {

   // check if event is from Checkout Page
   if (event.data.type && event.data.type === "checkoutpage.event") {
     
     // check if event is a checkout (purchase) event
     if (event.data.payload.event === "checkout") {
       // track purchase event here
       console.log(event.data.payload);
     }
   }
 });
</script>

The event.data.payload contains the following data:

  • event: "checkout"
  • checkoutId: the ID of your checkout
  • orderId: the ID of your customer's order
  • customerEmail: your customer's email address
  • value: the final purchase amount
  • currency: the currency of the purchase

Have a question about
Checkout Page?

Start selling in minutes with our no-code checkout page builder.

Create branded, custom checkout pages and increase revenue with one-click upsells and order bumps.

Whether on your website or in your sales funnel, our simple checkout process boosts sales.

Use cases

2024 © Checkout Page LLC. All rights reserved.

8 The Green, Ste R, Dover, DE 19901