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.

API Example

Node JS
1
// Prepare Request input data
2
const moment = require('moment');
3
const requestBody = {
4
name: 'Add To Cart',
5
customerId: 'YOUR_APP_CUSTOMER_ID', // YOUR APP'S CUSTOMER ID
6
time: moment().valueOf(), // Unix EPOCH time in Milliseconds
7
attributes:{
8
'Product Id' : 'abcdef',
9
'Product Name': 'Orange BagPack',
10
'Quantity': 3,
11
'Price': 4531,
12
'Discount': 0,
13
'Brand': 'Nike',
14
'Category': 'BagPack'
15
}
16
};
17
18
// Call API
19
const request = require('request-promise');
20
request({
21
method: 'POST',
22
uri: 'https://dc.growlytics.in/track/event',
23
headers: {
24
Accept: 'application/json',
25
'x-growlytics-key': '<GROWLYTICS-API-KEY>'
26
},
27
body: requestBody
28
});
Copied!

Terms & Considerations

  1. 1.
    Custom Event names must be less than 50 characters.
  2. 2.
    Custom Event Attribute names are case-sensitive.
  3. 3.
    Allowed data types for event attributes:String, Number, Boolean, Date
  4. 4.
    A maximum of 50 Event Attributes allowed per custom event.
  5. 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 5mo ago