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
Track Event API

https://dc.growlytics.in/track/event
Using /track/event API, you can add create events to Growlytics.
Request
Response
Request
Headers
x-growlytics-key
required
Growlytics API Key
Body Parameters
customerId
required
string
Customer id. Customer's unique identifier. Your system's customer id.
name
required
string
Event Name
time
required
number
Event time. Unix EPOCH time in Milliseconds.
attributes
required
object
Event attributes as key-value pairs. For example: { "Product ID": 1337, "Category": "Fragrance" }
Response
200: OK

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
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
});

Terms & Considerations

  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.