Tracking Events (Shopify Only)
Use this api document only if you have integrated Growlytics Connector app from shopify app store.
Track Event API
Headers
Name
Type
Description
Request Body
Name
Type
Description
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
Last updated
Was this helpful?
