LogoLogo
HomeDashboardProduct Docs
  • Introduction
  • Core Concepts
    • Events
    • Sessions
    • User/Customer Profile
  • PLATFORM INTEGRATIONS
    • Shopify Integration
  • Sdk Integrations
    • Browser SDK
      • Integrate SDK
      • Track Events
      • Track Users
      • Configure Web Push
      • Reading Session Identifer
      • Syncing Cart Items
    • Android SDK (Coming Soon)
      • Install Android Sdk
      • Identify Customers
      • Push Notification Integration
    • iOS SDK
      • Install iOS Sdk
      • Tracking User
      • Tracking Events
      • Push Notification Settings
        • Configure APNS In Growlytics
        • Configure Mobile App For Push
        • Handling Push Click
    • Other
      • Upload Customers using CSV
  • Channel Integrations
    • Email
      • Amazon SES
      • SendGrid
      • Custom SMTP
    • Mobile Push Notifications
      • Configure FCM Channel
    • Web Push Notifications
    • Ad Networks
      • Facebook Audiences
      • Google Ad Audiences
  • REST APIs
    • Overview
    • Tracking Users (Shopify Only)
    • Tracking Users (Non-shopify)
    • Tracking Events (Shopify Only)
    • Tracking Events (Non-shopify)
    • Syncing Products
    • Mobile App Apis
  • Webhooks
    • Coupon Webhook
    • Connector Webhooks
Powered by GitBook
On this page
  • Track Event API
  • API Example
  • Terms & Considerations

Was this helpful?

  1. REST APIs

Tracking Events (Shopify Only)

Use this api document only if you have integrated Growlytics Connector app from shopify app store.

PreviousTracking Users (Non-shopify)NextTracking Events (Non-shopify)

Last updated 1 year ago

Was this helpful?

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://dc.growlytics.in/track/event/v2

Using /track/event/v2 API, you can add create events to Growlytics.

Headers

Name
Type
Description

x-growlytics-key*

String

Growlytics API Key

Request Body

Name
Type
Description

customerId*

string

Customer id. Customer's unique identifier. Your system's customer id.

name*

string

Event Name

time*

number

Event time. Unix EPOCH time in Milliseconds.

attributes*

object

List of Attributes of Event

Growlytics supports Number, BigInt, String, Boolean and Date data types for event property values. For further details refer to

API Example

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: [
    { 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' },

    // Array Types
    { name: 'Product IDs', value: ['pid1', 'pid2', 'pid3'], type: 'string array' },
    { name: 'Sku Purchased', value: ['sku1', 'sku4', 'sk2'], type: 'string array' },

    // Key Value Attributes
    { name: 'Payment Details', value: { payment_mode: 'cod', transaction_id: '8276473782342' }, type: 'string map' },
    { name: 'Product Wise Discount Amount', value: { pid1: 12.7, p2: 11.5 }, type: 'number map' },
    { name: 'Product Wise Discount Used', value: { pid1: true, p2: true, pid3: false }, type: 'boolean map' },
    { name: 'Product Wise Delivery Dates', value: { p1: '2020-01-21 19:14:15', p2: '2020-01-20 15:14:15' }, type: 'date map' },

    // Custom Type
    {
      name: 'Full Order Details',
      type: 'custom',
      value: {
        'Order ID': 'SDFICSRDCVSSDSDG',
        Amount: 732.23,
        'Order Time': '2020-01-20 19:14:15',
        Products: [
          { id: 'pi1', name: 'Mixer', price: 100, quantity: 2 },
          { id: 'pi2', name: 'Juicer', price: 100, quantity: 5 }
        ]
      }
    }
  ]
};

// 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. A maximum of 50 Event Attributes allowed per custom event.

  4. 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.

Allowed data types for event attributes:String, Number, Boolean, Date, Map and Custom. For further details refer to

event tracking considerations.
event tracking considerations.