Metric Events [Draft]
Use Metric Events to create insights using your favorite analytics tool like Google Analytics
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
}