User actions tracking¶
To launch triggered push notifications campaigns, it is required to send the events about user actions to Devino.Online platform. To do this, you need to install several tracking codes on your website.
Supported types of events/actions:
- DevinoCategoryView - category view.
- DevinoProductView - product view.
- DevinoAddToCartEvent - add product to the cart.
- DevinoOrderEvent - make an order.
- DevinoEmailSync - user data transmission.
You need to install event dispatch code into the template of a particular page. It needs to be placed below the main tracking code.
Main tracking code installation¶
Main tracking code serves for sending the events to Devino.Online for further processing.
On all pages of the website, between the <head></head>
tags, you need to install the code:
<script src="https://integrationapi.net/web-sdk/devino-web-sdk.js"></script>
<script>
Devino.init();
</script>
Category view¶
To track the category view statistics, use DevinoCategoryView
event:
<script>
Devino.sendEvent({
"eventName":"DevinoCategoryView",
"eventData":{
"categoryId":"string",
"categoryTitle":"string",
"categoryUrl":"string"
}
})
</script>
- categoryId — category ID.
- categoryTitle — name of this category.
- categoryUrl — link to the category view.
Product view¶
The code needs to be placed on the product page.
<script>
Devino.sendEvent({
"eventName":"DevinoProductView",
"eventData":{
"productId":"string",
"productTitle":"string",
"productUrl":"string",
"productPrice":"string",
"productImgUrl":"string"
}
})
</script>
- productId — product ID in your catalog.
- productTitle — product name.
- productUrl — product link. You must specify the full path to the product.
- productPrice — product price.
- productImgUrl — product image link. You must specify the full path to the image.
Add product to the cart¶
It is required to install the event dispatch code on click by button Add to cart
. Code should be added on every button Add to cart
: in the product card, on the category page and to the product recommendation blocks.
<script>
Devino.sendEvent({
"eventName":"DevinoAddToCartEvent",
"eventData":{
"productId":"string",
"productTitle":"string",
"productUrl":"string",
"productPrice":"string",
"productImgUrl":"string"
}
})
</script>
- productId — ID of the product added to the cart.
- productTitle — product name.
- productUrl — product link. You must specify the full path to the product.
- productPrice — product price.
- productImgUrl — product image link. You must specify the full path to the image.
Make an order¶
It is required to install the event dispatch code on the page Your order is placed
.
<script>
Devino.sendEvent({
"eventName":"DevinoOrderEvent",
"eventData":{
"cartTotalPrice":"23450.78"
}
})
</script>
User data transmission¶
It is required to install the event dispatch code on each form: sign in form, sign up form, mail subscription form, checkout form — everywhere a user may leave his email address.
<script>
Devino.updateCustomerData({
"email": "john.doe@gmail.com",
"customData": {
"name": "John Doe",
"customProperty": "value"
}
});
</script>
- email — user's email address.