Tracking Events
Track an event by providing an event name, customer id, and event properties. Sending events to Growlytics requires a POST request with a JSON payload specifying the event information.
post
https://dc.growlytics.in
/track/event
Track Event API
Growlytics supports
Number, BigInt, String, Boolean
and Date
data types for event property values. For further details refer to event tracking considerations. Node JS
// Prepare Request input data
const moment = require('moment');
const requestBody = {
name: 'Add To Cart',
customerId: 'YOUR_APP_CUSTOMER_ID', // YOUR APP'S CUSTOMER ID
time: moment().valueOf(), // Unix EPOCH time in Milliseconds
attributes:{
'Product Id' : 'abcdef',
'Product Name': 'Orange BagPack',
'Quantity': 3,
'Price': 4531,
'Discount': 0,
'Brand': 'Nike',
'Category': 'BagPack'
}
};
// Call API
const request = require('request-promise');
request({
method: 'POST',
uri: 'https://dc.growlytics.in/track/event',
headers: {
Accept: 'application/json',
'x-growlytics-key': '<GROWLYTICS-API-KEY>'
},
body: requestBody
});
- 1.Custom Event names must be less than 50 characters.
- 2.Custom Event Attribute names are case-sensitive.
- 3.Allowed data types for event attributes:
String
,Number
,Boolean
,Date
- 4.A maximum of 50 Event Attributes allowed per custom event.
- 5.Data types of each event attributes are defined when they are tracked for the first time. For the second time, if the data type is not matching with the original data type, attributes will be ignored.
Last modified 2yr ago