Tweakwise Personalization allows you to build a profile of your visitors to display tailor-made recommendations on every visit to your platform. Insights will provide insights in builder, template and algorithm usage.
A typical e-commerce implementation measures the following actions:
- Search
- View item details
- Make purchases
Client-side
To do a client-side implementation, follow the recipe:
Search
To measure how many times a user has searched, send a search event whenever a user enters a search term, including the query the user has entered.
tweakwiseLayer.push({
event: 'search',
data: {
profileKey: profileKey,
searchTerm: 'Jeans'
}
});
View item details
To measure how many times item details are viewed, send a productView event whenever a user views an item’s details screen. For details on the parameters to send, see the reference section.
tweakwiseLayer.push({
event: 'productView',
data: {
profileKey: profileKey,
productKey: '1234'
}
});
Make purchases
To measure how many times an item is purchased, send the purchase
event on the conversion page, in e-commerce, this usually is the order completed or "thank you" page.
tweakwiseLayer.push({
event: 'purchase',
data: {
profileKey: profileKey,
productKeys: ['ARTICLENUMBER1', 'ARTICLENUMBER2', 'ARTICLENUMBER2']
}
});
Server-side
For a server-side implementation, hit the right endpoints on the locations necessary:
Search
To measure how many times a user has searched, send a search event whenever a user enters a search term, including the query the user has entered.
curl --request POST \
--url https://navigator-analytics.tweakwise.com/api/search \
--header 'Instance-Key: c1a12e92' \
--header 'content-type: text/json' \
--data '
{
"SearchTerm": "hoodie",
"ProfileKey": "c1a12e92"
}
'
View item details
To measure how many times item details are viewed, send a productView event whenever a user views an item’s details screen. For details on the parameters to send, see the reference section.
Note: the product key used here should be known in Tweakwise
curl --request POST \
--url https://navigator-analytics.tweakwise.com/api/pageview \
--header 'Instance-Key: c1a12e92' \
--header 'content-type: text/json' \
--data '
{
"ProfileKey": "c1a12e92",
"ProductKey": "101"
}
'
Make purchases
To measure how many times an item is purchased, send the purchase
event on the conversion page, in e-commerce, this usually is the order completed or "thank you" page. Including all the purchased items.
Note: the item id's used here should be known in Tweakwise
curl --request POST \
--url https://navigator-analytics.tweakwise.com/api/purchase \
--header 'Instance-Key: c1a12e92' \
--header 'content-type: text/json' \
--data '
{
"ProfileKey": "c1a12e92",
"ProductKeys": [
"101",
"102"
]
}
'