Events Tracking
Step 1. System Activity & their Tracking
To ensure tracking of system defined activities following configurations are to be made to the Netcore CE Javascript SDK.
Here is the reference for the Sample Events Sheet by business vertical
Below activity being considered is Page Browse, one of the System Defined Activities.
smartech('dispatch','page browse',{});
Once the above code is added over to the Netcore CE JS SDK, this is how the final code will look like -
<script src=’//cdnt.netcoresmartech.com/smartechclient.js’></script>
<script>
smartech('create', '<Smartech Panel identifier>');
smartech('register', '<Website Identifier>');
smartech('identify', '<Unique user identifier/Primary Key of the smartech panel >');
smartech('dispatch','page browse',{});
</script>
Important Note - For Activities to be tracked and send over to IDC(Indian Data Centres), 'IN' in case of Alibaba servers and 'TIN' in case of Tata Servers is to be added to the right of the Netcore CE panel identifier. Refer to the final code below('IN' has been considered in the below case) -
<script src=’//tw.netcore.co.in/smartechclient.js’></script>
<script>
smartech('create', '<Smartech Panel identifier>','IN');
smartech('register', '<Website Identifier>');
smartech('identify', '<Unique user identifier/Primary Key of the smartech panel >');
smartech('dispatch',1,{});
</script>
Once the above configuration is done, not only the configured activity will be tracked, also you will be able to run Web Push Notifications and Web Messages specific to that Activity.
Same way the following System Activites can also be configured.
Event Name | Description | Parameter | Event Id |
---|---|---|---|
Page Browse | Whenever the user is browsing a page, this event is fired. | None | 1 |
Add To Cart | Whenever the user adds a product to the cart. | Product Name Category Price PrId Currency Product Image Product Quantity(In case the same product is added once again) | 2 |
Checkout | Whenever the user does a checkout. | None | 3 |
Remove From Cart | Whenever the user removes a product from the cart. | Product Name Category Price Currency PrId Product Quantity(In case if a product quantity is affected) | 5 |
Product Search | Whenever the user searched for a product. | Search Term | 27 |
Product View | Whenever the user views a product. | Name Category Price Currency Product Image | 28 |
Lead Submitted | In case of a signup/register/lead form, lead details are send over to Netcore CE. | Form Details along with Primary Key. | 29 |
Product Purchase | Whenever the user successfully completes a purchase. | Cart value Currency Transaction Id Item count Shipping Country Shipping Region Shipping City | 30 |
Add to Wishlist | Whenever the user adds a product to the wishlist. | Product Name Category Price PrId Currency | 35 |
Remove from Wishlist | Whenever the user removes a product from the wishlist. | Product Name Category Price PrId Currency | 36 |
If primary key not one of the fields then form details won't be sent over to Netcore CE. Attributes for other fields other than primary key are to be added first in Netcore CE.
Product Quantity(PrQt) and Product ID(PrId) are mandatory parameters which if not passed, though the event will be captured, the digestification of these parameters for sending cart specific messages won't happen.
Step 2. Custom Activity Tracking
Any activity to be tracked other than the system activities can be done with the help of Auto Discovery.
Auto Discovery will let you track any activity using “dispatch” with the activity name and payload parameters (activity properties).
Every activity will have two attributes, activity name, and key-value pairs of payload parameters
Note
You can send maximum of 100 unique custom events names. Any additional events exceeding this limit will be dropped. You can reach out to your account manager if you want to send more events.
smartech('dispatch', '<activity name>', <value in JSON>);
//Example
smartech('dispatch', 'Product View', {
'productname': 'T-shirt',
'size': 'M',
'price': 999.10
});
Important Points
- CE will automatically discover new activity by activity name along with payload parameters and data types.
- CE supports following data types - string (text), integer, float, date and an array.
- CE will automatically convert the activity name into lowercase.
- CE will not allow duplicate activity name.
- Please provide the value of the date in following format - YYYY-MM-DD HH:MM:SS format.
- The maximum length of the activity name is 50 characters.
- The maximum length of the payload parameter {key} is 120 characters.
- The maximum length of the payload parameter value of a specific key is 512 characters.
- The maximum number of payload parameters allowed per activity is 100.
- The event which contains multiple object array will be dropped by CE.
- For revenue and conversion tracking, the data type should be Integer or Float.
Array Event (for website)
Netcore CE supports array data type and you can track activities like product purchase using an array.
// For passing single product information
smartech('dispatch', 'Product Purchase', {
"Amount" : 36899.74,
"txid" : "UATX123454",
"Currency" : "INR",
"Delivery Date" : "2017-01-09T00:00:00.000Z",
"items" : [
{
"SKU Code": "ACNF2425FDRWQRHW",
"prid": 13456,
"brand": "Voltas",
"prname": "1.5 Ton 3 Star BEE Rating 2018 Inverter AC",
"Price": 35999.75,
"prqt": 1,
"productimage" : https://www.sample.com/sample.jpg
}
]
});
// For passing multiple product information
smartech('dispatch', 'Product Purchase', {
"Amount" : 36899.74,
"txid" : "UATX123454",
"Currency" : "INR",
"Delivery Date" : "2017-01-09T00:00:00.000Z",
"items" : [
{
"SKU Code": "ACNF2425FDRWQRHW",
"prid": 13456,
"brand": "Voltas",
"prname": "1.5 Ton 3 Star BEE Rating 2018 Inverter AC",
"Price": 35999.75,
"prqt": 1,
"productimage" : https://www.sample.com/sample.jpg
},
{
"SKU Code": "TSHFFZTHF96HSW2X",
"prname": "Men V-neck Multicolor T-Shirt",
"Price": 899.99,
"prid": 13456,
"brand": "US POLO ASSN",
"prqt": 2,
"productimage" : https://www.sample.com/sample.jpg
}
]
});
smartech('dispatch', '<activity name>', <value in JSON>);
//Example
smartech('dispatch', 'Product Information', {
'productname': 'T-shirt',
'size': 'M,
'price': 999.10
});
Step 3: Validate event integration
You can follow the steps given here if you want to validate the implementation of your events.
Updated 2 months ago