Python

Download on GitHub

After downloading the client, add the indicative.py file to your project. Before you start recording events, call theinit() method and pass in your project’s API key:

indicative.init('Your-API-key-goes-here')

You should only have to do this once. Next, to record an event, set up a dictionary object with your property names and value, and then call the record()method. Its usage looks like this:

properties = {'Gender': 'Female', 'Age': 23}
indicative.record('Registration', 'user47', properties)

The record() method takes three arguments: the event name, the user’s unique ID, and a dictionary containing the event’s property names and values. This method creates a JSON representation of your event and sends it to our API endpoint. Note that this is done synchronously.

2 users found this helpful