API Reference

๐Ÿ“˜

Kindly ensure to update your products and historical customer data (if any) before sending events to use automations, segments, and campaigns on the Contlo dashboard.

Now that you have created your account, synced your products, and connected your website with Contlo, all you need to do is to start sending across your users' events.

Events

Analyzing events is very important for understanding how users interact with a website. The events play an important role in decision-making.

Types of Events

There are three types of events handled by Contlo for custom businesses:

Message Events

These events are related to push notifications and are automatically captured when a user interacts with the notification after you have integrated our custom snippet with your website.

Custom Events

These events are your user journey events that you would track across the user journey.

You can send events with custom property, using Contlo's Track API v1. Some examples of custom store events -

Use our Track API v1 for sending the following example events-

EVENTSDESCRIPTION
Viewed ProductWhen someone views a product
Added to CartWhen someone adds an item to their cart
Started CheckoutWhen someone lands on the checkout page
Placed OrderWhen an order successfully processes on your system
Fulfilled OrderWhen an order is processed
Cancelled OrderWhen an order is cancelled
Refunded OrderWhen a customerโ€™s order is refunded
Order in TransitWhen an order is in transit
Order DeliveredWhen an order is delivered to the customer.

Over here - Track API v1, you'll find a generic example for how to use the Track API v1. This example does not point out to the usage of a specific event but instead, generally points out to what the Track API v1 for an event could look like.

Charged Events

This is a special event that captures details of customer purchases, including items, categories, transaction amount, transaction ID, and information about the respective user. Recording a purchase against a user marks them as a customer in Contlo. This enables you to compare your funnel reports between customers and non-customers.

Properties

The charged event has the following properties:

ParameterTypeDescription
event_idstringUsed to map the event.
transacation_valuestringThe total transaction amount attributed to the revenue.
variant_idstringThe corresponding variant(s) ID for which the transaction is taking place.
event_typestringType of event (Charged)
currencystringCurrency code of variant prices. Follows ISO 4217:2015 format.
transaction_idstringUnique identifier of the transaction.
emailstringEmail ID of the customer
phone numberstringPhone number of the customer.
product_idstringThe corresponding product (s) ID for which the transaction is taking place.
timeLongEpoch time in milliseconds.

Sample JSON:

{
   "event_id":95962,
   "event":"order_placed",
   "email":"[email protected]",
   "phone_number":"+911234567890",
   "properties":{
      "event_type":"charged",
      "transaction_value":6600,
      "transaction_id":"pay_N0km1m5ZSVp5kd",
      "order_id":"12344abc",
      "currency":"inr",
      "total_discount":123.34,
      "shipping_price":100.00,
      "subtotal_price":200,
      "total_tax":1234.00,
      "product_ids":[
         "20998",
         "18318",
         "18312"
      ],
      "collection_ids":[
         
      ],
      "variant_ids":[
         "20998INR",
         "18318INR",
         "18312INR"
      ],
      "product_prices":[
         100,
         200,
         300
      ],
      "product_quantities":[
         2,
         1,
         1
      ]
   },
   "device_event_time":1669899600000
}

Please note the following when sending a charge event:

  • Please send 0 if there is no discount/shipping price etc. and do not send null.
  • The total price is before adding the tax and discount.
  • Ensure to keep the products updated on Contlo to avoid any mismatch of product ID mapping.
  • No. of items in the arrays for product prices and quantity should be equal.

You can use all the above events created through the Track API v1 in your Automations.

WhatsApp Channel subscription

To send WhatsApp subscription status to Contlo, you can use whatsapp_opt_in flag which accepts a boolean value. Add this to your profile_property.

{
    "event": "custom_event_name",
    "email": "[email protected]",
    "phone_number": "+919999998888",
    "properties": {
        "event_type":"custom",
        "source": "Web",
    },
    "profile_properties": {
        "whatsapp_opt_in": true
    },
    "device_event_time": 1706012816000
}

Verify Integration

After setting up, to verify your integration you can send a sample event to Contlo. Once the event is sent, go to Audience section on the Contlo platform.

If you can see a user profile created with the sample event, then this means that you have completed the integration.

Welcome aboard!!