Conversion event tracking

How to track conversion events (purchases and form submissions) and fire custom scripts when they occur

What is conversion event tracking?

Conversion event tracking records when customers complete a transaction or submit a form. This allows you to measure performance and fire custom scripts when these events occur.

Checkout Page fires different events depending on the page type:

  • Checkout pages and event pages fire a checkout event with purchase details (value, currency, order ID, etc.)
  • Form pages fire a submission event with the submitter's email

How do I track conversion events?

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; get in touch via the support chat.

The following script should be added to your own website, on each page where you have embedded your checkout or form.

<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") {          // checkout and event pages fire a "checkout" event     if (event.data.payload.event === "checkout") {       console.log("Purchase completed", event.data.payload);     }     // form pages fire a "submission" event     if (event.data.payload.event === "submission") {       console.log("Form submitted", event.data.payload);     }   } });</script>

Checkout event payload (checkout and event pages)

The event.data.payload for the checkout event contains:

  • event: "checkout"
  • checkoutId: the ID of your checkout
  • orderId: the order ID of your customer's order
  • customerEmail: your customer's email address
  • value: the final purchase amount
  • currency: the currency of the purchase
  • coupon: the coupon code used (if any)

Submission event payload (form pages)

The event.data.payload for the submission event contains:

  • event: "submission"
  • pageId: the ID of your form page
  • customerEmail: the email address submitted in the form

On this page