Tracking Events (Non-shopify)

Use this apis if you are not using shopify.

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.

Track Event API

POST https://dcqs-india.growlytics.in/rest-api/event

Using /rest-api/event API, you can add events to Growlytics.

Headers

Request Body

Growlytics supports number, string, boolean and date data types for event property values. For further details refer to event tracking considerations.

API Example

const moment = require('moment');
const requestBody = {
  name: 'Add To Cart',
  customerId: 'YOUR_APP_CUSTOMER_ID', // YOUR APP'S CUSTOMER ID
  attributes: [
    { name: 'Order ID', value: 'SDFICSRDCVSSDSDG', type: 'string' },
    { name: 'Amount', value: 732.23, type: 'number' },
    { name: 'Order Time', value: '2020-01-20 19:14:15', type: 'date' }, // Date in YYYY-MM-DD HH:mm:ss format
    { name: 'Is Prepaid Order', value: true, type: 'boolean' }
  ]
};

// Call API
const request = require('request-promise');
request({
    method: 'POST',
    uri: 'https://dcqs-india.growlytics.in/rest-api/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, attribute values will be ignored.

Last updated