1

When trying to create an order in Sitecore CDP/Sitecore Personalize, I am sending in an ADD, CONFIRM and CHECKOUT event but my checkout event is continuously failing. Why are some reasons that a CHECKOUT event might fail?

3 Answers 3

1

Below are some common issues that cause a CHECKOUT event to fail, resulting in no order being created in Sitecore CDP/Sitecore Personalize.

For more information see our knowledge hub: https://sitecore.cdpknowledgehub.com/docs/web-tagging-testing-and-troubleshooting#orders-not-created

1

It can be also wrong format of data in the CONFIRM event. Make sure that you always send list of products as array - even when you want to confirm only one product.

If you send something like that:

var viewEvent = {
      "browser_id" : _boxever.getID(),
      "channel" : "WEB",
      "type" : "CONFIRM",
      "language" : "EN",
      "currency" : "USD",
      "page" : window.location.href,
      "pos" : "Sygnity",
      "product" : 
        {"item_id" : "LenovoX1"}
      ,
      "_bx_extended_message" : "1"
    };
    _boxever.eventCreate(viewEvent, function(data){},"json");

Sitecore CDP will accept it and even (according to the debug mode) process it:

{
  "ref": "488ee8a3-f57c-4870-976d-cce0529971ad",
  "clientKey": "psfu6uh05hsr9c34rptlr06dn864cqrx",
  "createdAt": "2022-02-15T16:00:30.893Z",
  "modifiedAt": "2022-02-15T16:00:30.897Z",
  "type": "CONFIRM",
  "status": "PROCESSED",
  "channel": "WEB",
  "pointOfSale": "Sygnity",
  "browserRef": "31f55dae-04b1-4708-83e7-3f13f8817a7d",
  "sessionRef": "6c31e4ba-0263-4cae-b08d-e99bd0aae30a",
  "arbitraryData": {
    "product": {
      "item_id": "LenovoX1"
    },
    "_bx_version": "1.2",
    "language": "EN",
    "page": "https://polarized-disco-click.glitch.me/",
    "currency": "USD",
    "_bx_extended_message": "1"
  },
  "flowExecution": {}
},

But CHECKOUT event will fail.

If you send the same CONFIRM event with products in array structure:

var viewEvent = {
      "browser_id" : _boxever.getID(),
      "channel" : "WEB",
      "type" : "CONFIRM",
      "language" : "EN",
      "currency" : "USD",
      "page" : window.location.href,
      "pos" : "Sygnity",
      "product" : [
        {"item_id" : "LenovoX1"}
      ],
      "_bx_extended_message" : "1"
    };
    _boxever.eventCreate(viewEvent, function(data){},"json");

Result in the debug mode will be exactly the same (with different structure of the product data):

{
  "ref": "803ee756-84a5-45cb-906c-516f8641aee2",
  "clientKey": "psfu6uh05hsr9c34rptlr06dn864cqrx",
  "createdAt": "2022-02-15T16:05:30.865Z",
  "modifiedAt": "2022-02-15T16:05:30.875Z",
  "type": "CONFIRM",
  "status": "PROCESSED",
  "channel": "WEB",
  "pointOfSale": "Sygnity",
  "browserRef": "31f55dae-04b1-4708-83e7-3f13f8817a7d",
  "sessionRef": "ab65ddc4-e1bf-4b29-9336-501b5bd13751",
  "arbitraryData": {
    "product": [
      {
        "item_id": "LenovoX1"
      }
    ],
    "_bx_version": "1.2",
    "language": "EN",
    "page": "https://polarized-disco-click.glitch.me/",
    "currency": "USD",
    "_bx_extended_message": "1"
  },
  "flowExecution": {}
}

The difference will be visible in the result of CHECKOUT event which this time will be successful.

You can be also confused with the UI of CDP becasue in two scenarios purchase will be visible as "complete" (even when it failed it is still green).

enter image description here

0

I had exact same parameters which are required even with the matching item_id but still checkout event was failing. The root cause for that was having the product type as "FLIGHT" like below.

           "product": {
                "type": "FLIGHT",
                "item_id": "FLIGHT_1",
                "name": "DUB-LHR Economy Flight",
                "currency": "USD",
                "price": 200,
                "product_id": "DUB-LHR|Economy|EconomyPlus",
                "quantity": 1
            }

When I replace type as "FLIGHT" with anything else like "FOOD", it started working.

            "product": {
                "type": "FOOD",
                "item_id": "FLIGHT_1",
                "name": "DUB-LHR Economy Flight",
                "currency": "USD",
                "price": 200,
                "product_id": "DUB-LHR|Economy|EconomyPlus",
                "quantity": 1
            }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.