This event marks purchasing a set of items
How to implement?
<!-- INSTANCE_KEY SESSION_KEY AND PROFILE_KEY are inherited from the base tag -->
<script>
tweakwiseLayer.push({
event: 'purchase',
data: {
productKeys: ['ARTICLE_NUMBER_1', 'ARTICLE_NUMBER_2', 'ARTICLE_NUMBER_3'],
revenue: REVENUE
}
});
</script>curl --request POST \
--url 'https://navigator-analytics.tweakwise.com/api/addtowishlist?instanceKey=INSTANCE_KEY' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"ProfileKey": "PROFILE_KEY",
"SessionKey": "SESSION_KEY",
"ProductKey": "ITEM_ID"
}
'Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| INSTANCE_KEY | URL-parameter - text | yes | Your Tweakwise Instance Key |
| PROFILE_KEY | Body parameter - text | yes | The ID that identifies the current visitor. Read more about the profile key here |
SESSION_KEY | Body parameter - text | yes | The session key for the specific user. This can be your own session key or GA session. As long as it's consistent over the user's session. Allowed characters: alphanumeric and hyphens |
ARTICLE_NUMBER_* | Body parameter - text | yes | The Tweakwise item ID of the product that has been purchased |
| REVENUE | Body parameter - decimal | yes | The total amount of the products (item price x quantity) |
When do I submit this event?
Submit this event when a visitor has purchased one or more items.
Where do I implement this event in the code?
On the 'Thank You' page of your shop that is shown after a purchase.
How to handle event-specific warnings from Tweakwise
SessionKey: xx% missing / ProfileKey: xx% missing / ProductKeys: xx% missing / Revenue: xx% missing
Please share your findings with your implementation partner. If they have questions about these messages, please have them contact [email protected].
