Skip to main content

Metric Events [Draft]

Use Metric Events to create insights using your favorite analytics tool like Google Analytics

Please Note

These events are intended to create analytic insights and make it possible to track the customer journey in Walley Checkout. Events might be triggered more than once for a session, and you will have to cater for this in your analytics tool

Examples​

/* Javascript event listeners using DOM */

function listener(event) {
// See event types in table below
console.log(event.type);

// Example payload. Note this is an object and you need to parse this accoring to event payload in the table
const payload = event.payload;

// Send to your analytics tool, example with Google Analytics
gtag("event", event.type, {
app_name: "MyWebSite",
value: payload,
});
}

document.addEventListener("walleyCheckoutMetric", listener);

Example event object​

{
// public token for the session emitting the event
"token": "public-SE-000000000000000000000000000000000000000000000000",
"payload": {
// This is the type described below
"type": "PaymentOptionSelected",

// Payload according to event type
"paymentOption": {
"paymentMethodName": "PartPayment",
"paymentOptionId": 6
}
}
}

Event definitions​

The following describes the payload object of each event emmited

Initialized​

The Checkout was successfully Initialized, occurs right before rendering


"payload": {
"type": "Initialized"
}

InView​

The Checkout has been rendered and is within the viewport of the user

"payload": {
"type": "InView",
}

CustomerIdentified​

The customer has been successfully identified by the user (not by prefill or preset by merchant)

"payload": {
"type": "CustomerIdentified",
}

DeliveryAddressChanged​

The delivery address has been updated. Occurs automatically when a customer is identified, or when a user changes it manually

"payload": {
"type": "DeliveryAddressChanged",
}

ShippingMethodSelected​

A shipping method (or a sub-choice of a shipping method) has been selected by the user. Occurs only when shipping is used in the checkout.

"payload": {
"type": "ShippingMethodSelected",
}

PaymentCategorySelected​

A payment category has been selected by the user

"payload": {
"type": "PaymentCategorySelected",
"paymentMethod": "postDelivery"
}

PaymentMethodSelected​

A payment method has been selected by the user, or default value set when payment category is selected

"payload": {
"type": "PaymentMethodSelected",
"paymentMethod": "DirectInvoice"
}

PaymentOptionSelected​

Occurs when a sub-choice of a payment method has been selected, for example duration of payment method

"payload": {
"type": "PaymentOptionSelected",
"paymentOption": {
"paymentMethodName": "PartPayment",
"paymentOptionId": 6
}
}

CommitedToPurchase​

The user has clicked the Complete purchase CTA button

"payload": {
"type": "CommitedToPurchase",
}

SCARequested​

The user has been presented with a dialogue stating that Strong Customer Authentication is required for this purchase

"payload": {
"type": "SCARequested",
}

SCAStarted​

The user is either redirected to SCA when in NO, FI, DK. When using BankID in SE this is not triggered since it is done on device or by scanning QR code.

"payload": {
"type": "SCAStarted",
}

SCACanceled​

The user canceled manually, or the SCA session timed out.

"payload": {
"type": "SCACanceled",
}

KALPRequested​

The user has been presented with a dialogue stating that KALP (Household calculation) is required to continue.

"payload": {
"type": "KALPRequested",
}

KALPCanceled​

The KALP was canceled by the user

"payload": {
"type": "KALPCanceled",
}

KALPSubmitted​

The KALP was successfully submitted

"payload": {
"type": "KALPSubmitted",
}

PurchaseFailed​

The purchase failed. This could be due to several reasons including credit check denied or fraud rules. We cannot reveal the reason to this due to privacy and secrecy.

"payload": {
"type": "PurchaseFailed",
}

PurchaseCompleted​

The purchase was successfully completed.

"payload": {
"type": "PurchaseCompleted",
}

CustomerFeedback​

The user gave feedback about the purchase.

"payload": {
"type": "CustomerFeedback",
"customerSatisfied": true
}