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.
Installation
The Insights Tag is a lightweight javascript SDK to capture key e-commerce events on your platform. This snippet should be implemented on the frontend of your platform.
Follow the recipe to see implementation details:
Essentials
To analyze the performance of your configuration and power some of our insights reports, we gather information from key requests.
Click product
To measure how many times an item is clicked, send a itemClick
event whenever a user clicks/taps an item. It is crucial for analyzing the performance of builder components.
Property | Required | Value / description |
---|---|---|
itemId | yes | The unique id of the item |
requestId | yes | The id of the linked navigation request. See Identification by request. |
tweakwiseLayer.push({
event: 'itemClick',
data: {
itemId: 'item-id-123',
requestId: '45fdf-a5401-845d5-596b7-99226-14a43-5bcf'
}
});
Note: this is only available if a response contains a requestId. To learn more, go to Identification by request.
Personal Events
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.
Property | Value / description |
---|---|
profileKey | The profile key identifying the visitor. |
productKeys | Array of unique id's of the items in the transaction |
tweakwiseLayer.push({
event: 'purchase',
data: {
profileKey: profileKey,
productKeys: ['ARTICLENUMBER1', 'ARTICLENUMBER2', 'ARTICLENUMBER2']
}
});
View product
To measure how many times item details are viewed, send a productView
event whenever a user views an item’s details screen.
Property | Value / description |
---|---|
profileKey | The profile key identifying the visitor. |
productKey | The unique id of the item |
tweakwiseLayer.push({
event: 'productView',
data: {
profileKey: profileKey,
productKey: 'ARTICLENUMBER1'
}
});
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.
Property | Value / description |
---|---|
profileKey | The profile key identifying the visitor. |
searchTerm | The search term the visitor used to search for products. |
tweakwiseLayer.push({
event: 'search',
data: {
profileKey: profileKey,
searchTerm: 'Jeans'
}
});
Identification
By request
Every API request returns a unique request identifier that can be passed to these e-commerce events. In the background, we store the event information and request relation. This enables us to analyze the configuration of builder, filter templates, algorithms and give Actionable Insights.
The request identifier is sent in the response headers:
curl --request GET \
--url https://gateway.tweakwisenavigator.com/navigation/c1a12e92 \
--header 'accept: text/xml'
Twn-Request-Id: cae158c4107789408a7ac8f0eedc57a3
You can use this requestId to send with all the events that require the requestId.
By profile
Customer profiles are built by associating a request or customer with various events. The information gathered from these events is used to create a profile for each customer, enabling us to display personalized product recommendations.
Go to the following topics to learn more about personalization details:
- If you want more information about identifying a customer, go to Identification.
- In case you want to know more about calucations and retention, go to Profiles.