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 NameDescriptionParameterEvent Id
Page BrowseWhenever the user is browsing a page, this event is fired.None1
Add To CartWhenever 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
CheckoutWhenever the user does a checkout.None3
Remove From CartWhenever 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 SearchWhenever the user searched for a product.Search Term27
Product ViewWhenever the user views a product.Name
Category
Price
Currency
Product Image
28
Lead SubmittedIn case of a signup/register/lead form, lead details are send over to Netcore CE.Form Details along with Primary Key.29
Product PurchaseWhenever the user successfully completes a purchase.Cart value
Currency
Transaction Id
Item count
Shipping Country
Shipping Region
Shipping City
30
Add to WishlistWhenever the user adds a product to the wishlist.Product Name
Category
Price
PrId
Currency
35
Remove from WishlistWhenever the user removes a product from the wishlist.Product Name
Category
Price
PrId
Currency
36

📘

  1. 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.

  2. 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

  1. CE will automatically discover new activity by activity name along with payload parameters and data types.
  2. CE supports following data types - string (text), integer, float, date and an array.
  3. CE will automatically convert the activity name into lowercase.
  4. CE will not allow duplicate activity name.
  5. Please provide the value of the date in following format - YYYY-MM-DD HH:MM:SS format.
  6. The maximum length of the activity name is 50 characters.
  7. The maximum length of the payload parameter {key} is 120 characters.
  8. The maximum length of the payload parameter value of a specific key is 512 characters.
  9. The maximum number of payload parameters allowed per activity is 100.
  10. The event which contains multiple object array will be dropped by CE.
  11. 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.