Server to server

To power dynamic re-ranking and our insights reports, we want to capture key e-commerce events on your platform, such as product views, clicks, add-to-carts, and purchases.

The Insights Tag is just a wrapper to our Analytics API. Every method exposed in the tag is also available as an API endpoint. This way you can also set up the tag on your back-end, without the need for any frontend changes.

Events

Click product

To measure how many times an item is clicked, send a itemClick event whenever a user clicks/taps an item.

PropertyValue / description
RequestIdThe unique id of the item
ItemIdThe id of the linked navigation request.
curl --request POST \
     --url https://navigator-analytics.tweakwise.com/api/itemclick \
     --header 'Instance-Key: INSTANCEKEY' \
     --header 'content-type: text/json' \
     --data '
{
  "RequestId": "d03c40f5-6894-4e4f-9cd8-95d4efe38eaa",
  "ItemId": "item123"
}
'

Purchase

The purchase event tracks the transaction of your customers. It is crucial for analyzing the overall performance of algorithm usage, builder, filter templates and more.

PropertyValue / description
ProductKeysArray of unique id's of the items in the transaction
ProfileKeyThe profile key identifying the visitor.
RevenueThe total revenue from the purchase, calculated as the sum of product prices after discounts have been applied and before taxes are added. Can be empty, or must contain a value greater than or equal to 0.
curl --request POST \
     --url https://navigator-analytics.tweakwise.com/api/purchase \
     --header 'Instance-Key: INSTANCEKEY' \
     --header 'content-type: text/json' \
     --data '
{
  "ProductKeys": [
    "3129",
    "6471"
  ],
  "ProfileKey": "tw.fg$ae12deH.8631552",
  "Revenue": 124.50
}
'

View product

To measure how many times item details are viewed, send a productView event whenever a user views an item’s details screen.

PropertyRequiredValue / description
ProductKeyyesThe unique id of the item
ProfileKeyyesThe profile key identifying the visitor.
SessionKeynoThe sessionkey for the specific user. This can be your own sessionkey, GA session. As long as it's consistent over the users' session.
Allowed characters: alphanumeric and hyphens ([a-zA-Z0-9-])
curl --request POST \
     --url https://navigator-analytics.tweakwise.com/api/productview \
     --header 'Instance-Key: INSTANCEKEY' \
     --header 'content-type: text/json' \
     --data '
{
  "ProductKey": "3129",
  "ProfileKey": "tw.fg$ae12deH.8631552",
  "SessionKey": "jfAbyWef52319mDfa"
}
'

Search

To measure the amount of search queries, send a search event when a user enters a search term, including the term the user has entered.

PropertyValue / description
SearchTermThe search term the visitor used to search for products.
ProfileKeyThe profile key identifying the visitor.
curl --request POST \
     --url https://navigator-analytics.tweakwise.com/api/productview \
     --header 'Instance-Key: INSTANCEKEY' \
     --header 'content-type: text/json' \
     --data '
{
  "SearchTerm": "jeans",
  "ProfileKey": "tw.fg$ae12deH.8631552"
}
'