Skip to main content

Documentation Portal

Abandoned Carts

This section details the steps required to trigger abandoned cart emails and other abandoned cart processes.

Note that Global-e must enable this feature for you. Contact your Client Success Manager to have this feature enabled.

To initiate abandoned cart emails and other abandoned cart processes:

  1. Implement the OnCheckoutStepLoaded listener. (See OnCheckoutStepLoaded)

    glegem("OnCheckoutStepLoaded", function (data) {
        switch (data.StepId) {
        case data.Steps.LOADED:
            break;
        case data.Steps.CONFIRMATION:
            if (data.IsSuccess) {
                // Analytics tags can be added here
            }
            break;
        }
    });
  2. Capture and store the customer’s e-mail address. Implementing this using our Advanced Analytics features.

    glegem("OnClientEvent", function (source, data) {
        switch (source) {
        case GEMerchantUtils.ClientEvents.INPUT_BLUR:
            if (typeof data.name != 'undefined') {
                if (data.name == 'CheckoutData.Email') {
                    console.log('email changed' + data.value);
                }
            }
            break;
        }
    });
  3. Implement the CONFIRMATION event case in your analytics code to remove the stored customer email since this indicates this particular cart was converted.

    glegem("OnCheckoutStepLoaded", function (data) {
        switch (data.StepId) {
        case data.Steps.CONFIRMATION:
            if (data.IsSuccess) {
                // Mark checkout as completed/not abandoned
            }
  4. After 5 to 15 minutes, you can trigger abandoned cart email notifications or other relevant processes using the captured email address, as it signifies an incomplete checkout.

Klaviyo

If you are using Klaviyo:

  1. Make sure to report that the checkout has started. Implement this by using the data.Steps.LOADED. (See OnCheckoutStepLoaded Callback)

  2. Retrieve data about the products in the cart or trigger your existing Klavyio data layer implementation.

  3. When the customer enters the email address on the Global-e checkout page, handle this event and report to Klaviyo.

  4. Make sure to report the completed checkout to Klaviyo to prevent the cart from being marked as abandoned. Implement this by using the data.Steps.CONFIRMATION case. (See OnCheckoutStepLoaded Callback)