📍 Bolt Help / Core Products / Embedded Accounts / Implement Data Event Tracking (Optional)

Implement Data Event Tracking (Optional)

Merchants with custom cart implementations can invoke an analytics method that tracks checkout funnel events.

Before You Start

This article assumes you have installed the Bolt script.

Installation

1. Invoke Analytics Method

Invoke this method with a different stepName during each step of checkout. Some event types allow you to add context to captured events.

window.BoltAnalytics.checkoutStepComplete(stepName, args)
Parameter Format Required?
stepName String Yes
args Object No

2. Add Parameters to Analytics Method

Implement each event in the appropriate checkout step using the table below. Dynamically select argument values based on responses from other components in the embedded accounts flow.

stepName When to invoke args
"Detail entry began" When the shopper enters the first character into the email or phone input field. If the shopper is automatically logged in, this event may be skipped. None
"Account recognition check performed" When the checkout page receives a response from https://api.bolt.com/v1/account/exists.
NameValuesDynamic selection
hasBoltAccount
  • true
  • false
If account is detected, set to true
detectionMethod
  • “email”
  • “phone”
  • “device token”
  • Set according to identifier input type (usually "email")
  • Use "device token" when login occurred without identifier input
"Shipping details fully entered" When the delivery options successfully load, including default selection.
NameValuesDynamic selection
loginStatus
  • guest
  • logged-in
Upon undefined response from Authorization Modal, set to "guest"
"Shipping method step complete" When the shopper completes the shipping step, including default/pre-filled information, and moves to the next step. None
"Billing details entered" When the shopper completes the billing step, including default/pre-filled information, and moves to the next step. If billing info is the same as shipping info, invoke this with “Payment details fully entered”. None
"Payment method selected" When the shopper selects a payment method, and each time they change the selection.
NameValuesDynamic selection
paymentOptionstringSend the selected payment method’s name upon each click, and when the page loads the default selection
"Payment details fully entered" When the shopper completes their payment information. For logged-in shoppers, this may occur with "Payment method selected". None
"Clicks pay button" When the shopper initiates payment. None
"Payment complete" When the payment authorization is successful. None
"Payment rejected" When the payment authorization is unsuccessful. None

Example Implementation

The following example adds a method to track behavior upon completion of the shipping step:

onShippingComplete: () => {
  // this code runs after the shopper enters shipping details and continues to the next step of checkout
  window.BoltAnalytics.checkoutStepComplete("shipping details fully entered", { loginStatus: "guest" });
}
📖On This Page
Filter by Section
Filter by Topic