Integrating connecto’s api can help you in personalising your website or app with notifications based on user’s prior actions. With connecto you can track and analyse user’s behaviour and in turn improve visitors engagement.
Connecto tracks user’s events and actions in four ways. These are :
Page Call : Trigger to Page call occurs whenever the url changes or user loads any new page. This call can help us in identifying the number of visitors visiting any particular page.
Track Call : Trigger to Track call will happen for those components of a page for which we want to track user’s actions and what all events they performed. Basically to track user’s events in a page, track call is used.
Identify Call : Identify call triggers whenever there is a new user visiting a web page or if the existing details of any visiting user are updated.
Event Call : Event call triggers whenever a user visit visits or performs some action on mobile application. Depending on the event occurred, call to track or identify api occurs. The payload of event api call comes in a batch of 10, as android handles the events according to components rendered.
Now we will look at some of the attributes that are unique for each call.
properties : This object is sent by the client to connecto when a track call is made. This object contains all the user defined attributes that are used to track user’s events. For eg, we want to track information about a product, then the properties object can have the following attributes :
"properties":{
"PRODUCT TYPE": "abc",
"PRODUCT NAME": "abc",
"PRODUCT VARIANT": "abc",
"PRODUCT MODEL": "abc"
}
data : This object is sent by the client to connecto when a page call is made. This object consists of all the user defined attributes that are used to identify a particular page. For eg, we want to track information about a particular page, then the data object can have the following attributes :
"data":{
"AUTHOR NAME": "abc",
"PRODUCT TYPE": "abc",
"PRODUCT NAME": "abc",
"PRODUCT VARIANT": "abc",
"PRODUCT MODEL": "abc"
}
traits : This object is sent by the client to connecto when an identify call is made. It contains of all the attributes that are used to identify any user. For eg, traits object can have the following set of attributes :
"traits":{
"$email": "abc@connecto.com",
"$phone": "xxxxxxxxxx",
"$name": "connecto"
}
Note : All of these three objects -> properties/data/traits contain all the required attributes in key-value pairs. Connecto stores and and tracks all the attributes that it receives from the client. It does not perform any filtering and processing on them. So, the client should carefully send only those attributes for which he/she wants the tracking to be done, as connecto tracks all the data it receives.
- POST https://api.connecto.io/track
- POST https://api.connecto.io/page
- POST https://api.connecto.io/identify
- POST https://api.connecto.io/event
The data is of the form :
{
"messageId": "8ec8b94f-985e-0288-e8b9-f61c82331882",
"type": "page/track/identify",
"userId": "ee23df09-15c7-3b26-698c-cacc7368c497",
"anonymousId": "ee23df09-15c7-3b26-698c-cacc7368c497",
"timestamp": "2018-03-19T09:18:19.351Z",
"sessioncount": 2,
"context": {
"url": "https://www.cardekho.com/renault/captur/specs",
"utm_param": {},
"library": {
"name": "backend",
"version": "1.0"
}
}
"event": "Test event",
"writeKey": "xxxxxxxxxxxx",
"channel": "web/app",
"sentAt": "2018-03-19T09:18:19.352Z"
}
These attributes are common in all types of calls. Now we will look at those objects which are unique for each call.
"data": {
"PAGE TYPE": "ModelPage.SpecsTab",
"BODY TYPE": "SUV Cars",
"OEM NAME": "Renault",
"MODEL NAME": "Renault Captur"
}
"properties": {
"LeadLocation": "ConnectoExitDCBTimedelayRenaultModelPage.PicturesTab",
"Video Title": "DCB - Time delay - Renault",
"PAGE TYPE": "ModelPage.PicturesTab",
"BODY TYPE": "SUV Cars",
"OEM NAME": "Renault",
"MODEL NAME": "Renault Captur"
}
"traits": {
"$name": "abc",
"$email": "abc@connecto.com",
"$phone": "xxxxxxxxxx"
}
{
"batch": [
{
"messageId": "8caa091d-915d-4252-a723-359f2877600a",
"type": "identify",
"channel": "mobile",
"context": {
"app": {
"build": 120,
"name": "CarDekho",
"namespace": "com.girnarsoft.cardekho",
"version": "7.0.6.6"
},
"library": {
"name": "connecto-android",
"version": ""
},
"os": {
"name": "Android",
"version": "7.1.1"
},
"timezone": "Asia/Kolkata",
"screen": {
"density": 2.625,
"width": 1080,
"height": 1794
},
"userAgent": "Dalvik/2.1.0 (Linux; U; Android 7.1.1; Android SDK built for x86 Build/NYC)",
"locale": "en-",
"device": {
"id": "40fbb1335b6cef24",
"manufacturer": "Google",
"model": "Android SDK built for x86",
"name": "generic_x86"
},
"network": {
"wifi": false,
"carrier": "Android",
"bluetooth": false,
"cellular": true
}
},
"anonymousId": "1ed97665-9d47-4a95-ac56-73e1c6d33efa",
"userId": "40fbb1335b6cef24",
"writeKey": "XXXXX",
"timestamp": "2017-11-21T17:19:28+0530",
"traits": {
"First Name": "Test",
"mobile": "9001022773",
"userId": "40fbb1335b6cef24"
}
},
{
"messageId": "97cee42b-3827-4952-a82f-92c254c7a90f",
"type": "track",
"channel": "mobile",
"context": {
"app": {
"build": 120,
"name": "CarDekho",
"namespace": "com.girnarsoft.cardekho",
"version": "7.0.6.6"
},
"library": {
"name": "connecto-android",
"version": ""
},
"os": {
"name": "Android",
"version": "7.1.1"
},
"timezone": "Asia/Kolkata",
"screen": {
"density": 2.625,
"width": 1080,
"height": 1794
},
"userAgent": "Dalvik/2.1.0 (Linux; U; Android 7.1.1; Android SDK built for x86 Build/NYC)",
"locale": "en-",
"device": {
"id": "40fbb1335b6cef24",
"manufacturer": "Google",
"model": "Android SDK built for x86",
"name": "generic_x86"
},
"network": {
"wifi": false,
"carrier": "Android",
"bluetooth": false,
"cellular": true
}
},
"anonymousId": "1ed97665-9d47-4a95-ac56-73e1c6d33efa",
"userId": "40fbb1335b6cef24",
"writeKey": "XXXXX",
"timestamp": "2017-11-21T17:19:28+0530",
"event": "eventTracking",
"properties": {
"eventAction": "clicked",
"eventCategory": "tabs",
"vehicleType": "car"
}
}
],
"sentAt": "2017-11-21T17:23:47+0530",
"context": {
"ip": "115.248.233.98, 115.248.233.98",
"userAgent": "Dalvik/2.1.0 (Linux; U; Android 7.1.1; Android SDK built for x86 Build/NYC)",
"browser": {},
"device": {},
"os": {
"name": "Android",
"version": "7.1.1"
},
"engine": {},
"cpu": {}
}
}
This is a demo batch showing only 2 requests one each for identify and track. Each batch can consist of maximum 10 requests.