Server to server

To analyze the performance of your configuration, power our insights reports and support personalization, we capture key e-commerce events on your platform. These are events such as product views, item clicks, add-to-carts, and purchases.

The Insights Tag is a wrapper around 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.

To make full advantage of the reporting features, track:

  • item clicks on category pages, search results, suggestions and recommendations.
  • search phrases on search results pages
  • product views when viewing a product (detail page)
  • purchases when a conversion is logged (order is placed)

Events

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/search \
     --header 'Instance-Key: INSTANCEKEY' \
     --header 'content-type: text/json' \
     --data '
{
  "SearchTerm": "jeans",
  "ProfileKey": "tw.fg$ae12deH.8631552"
}
'

Click product

To measure how many times an item is clicked, send a itemClick event whenever a user clicks/taps an item. This should be implemented on search results & lister pages.

For every Delivery API request, the response will contain a unique identifier for that request: the requestId. This should be stored for that request, so it can be processed on the front-end when the user clicks/taps an item.

PropertyValue / description
RequestIdThe identifier of the linked Tweakwise request
ItemIdThe Tweakwise id of the clicked product/item.
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"
}
'

View product

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

Property

Required

Value / description

ProductKey

yes

The unique id of the item

ProfileKey

yes

The profile key identifying the visitor.

SessionKey

no

The 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 (hts Tag is j)

curl --request POST \
     --url https://navigator-analytics.tweakwise.com/api/pageview \
     --header 'Instance-Key: INSTANCEKEY' \
     --header 'content-type: text/json' \
     --data '
{
  "ProductKey": "3129",
  "ProfileKey": "tw.fg$ae12deH.8631552",
  "SessionKey": "jfAbyWef52319mDfa"
}
'

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
}
'