This endpoint receives user impression and conversion data.

You use this endpoint when you are building an API integration rather than using Tipser Elements or Tipser Script which have event tracking built in. There are 6 events that should be triggered by user behavior.

Event Types:

Product Tile Impression - PRODUCT_TILE_IMPRESSION
The POST request should be sent after a product tile is visible in the viewport.

Product Details Impression - PRODUCT_DETAILS_IMPRESSION
The POST request should be sent after a product details section is visible in the viewport.

Product Tile Click - PRODUCT_TILE_CLICK
The POST request should be sent after a product tile is clicked.

Add To Cart - ADD_TO_CART
The POST request should be sent after a product is added to cart.

Remove From Cart - REMOVE_FROM_CART
The POST request should be sent after a product is removed from cart.

Cart Impression - CART_IMPRESSION
The POST request should be sent after a cart is viewed.

Note that Product ID param is mandatory for all the events, except for Cart Impression.

Session Id:

sessionId - ex. 611ea8821a38264dd517e7 - All the clients using this API are responsible for generating a sessionId and maintaining it in the upcoming requests to the tracking endpoint. It should be generated once and stored in some form of a browser storage like a cookie of session storage.

The following snippet may be used by our customers to generate the sessionId:

const generateRandomHexStringOfLengthFour = () =>
  Math.floor((1 + Math.random()) * 0x10000)
    .toString(16)
    .substring(1);

function generateSessionId() {
  //Session id should be in the Mongo id format
  //Mongo ids must be 24 characters hexadecimal strings
  let result = '';
  for (let i = 0; i < 6; i++) {
    result += generateRandomHexStringOfLengthFour();
  }
  return result;
}

Session id should be included within Tipser Elements Configuration to assign events that are dispatched directly from Tipser Elements to the same user's session, example below:

const config = {
  lang: "en-US",
  primaryColor: "#0000FF",
  sessionId: "example_of_session_id"
}
Language
Click Try It! to start a request and see the response here!