NotifyVisitors offers an API for tracking events once you integrate your platforms through the SDK, it begins tracking the events. These are called system events. NV tracks user interactions with your apps and campaigns.

Apart from the system events, you can create custom events to track the other interactions of the users which are vital for your business. These created custom events are defined by the event attributes such as the price of the product, quantity, category, etc. Such type of data is used to engage customers via personalized campaigns across all engagement channels.

DIFFERENT API ENDPOINTS FOR TRACKING EVENTS

NotifyVisitors provides different API endpoints for tracking the custom and system events.

Upload events to create or update users

  • This endpoint enables you to create or update events. You can upload a maximum of 1000 users at a single API.
    https://analytics.notifyvisitors.com/api/v1/event/create

Getting users data that perform an event

  • In this API, you will get a list of user profiles. You only have to specify the event name, date range, and batch size.
    https://analytics.notifyvisitors.com/api/v1/event/get

Get total no. of profiles that meet an event query

  • This endpoint is used to get the total number of profiles that meet an event query.
    https://analytics.notifyvisitors.com/api/v1/event/count

Track events with respective dates

  • This endpoint is used to track events.
    https://analytics.notifyvisitors.com/api/v1/event/track

API RATE LIMIT

  • The API rate limit is the number of times the API can be requested per minute.
  • You can make up to 500 API requests per minute on an API.
  • If the limit exceeds, the app will throw an error in Response. All API requests are
    subject to rate limits.

Points to Remember

  • The name of the custom events must be less than 50 characters.

  • The names of the custom events are case sensitive. The string attribute values of the custom events must be less than 1000 characters.

  • Event attributes have the following data types: String, Number, Boolean, Date,JSON Array,JSON object. Remember that JSON objects can contain only one of these data types.

  • In case, the event attribute value is in a JSON object, it cannot be used to create segments. You can only use it to create personalized campaigns.

  • The data types must have consistent values that you can save against the attribute. If the data type is changed in the future, the custom event attribute data will not flow steadily in the NV dashboard.

PARAMETER

TYPE

DESCRIPTION

MANDATORY

userId

String

Either one of userId or anonymousId is mandatory.

No

anonymousId

String

Either one of userId or anonymousId is mandatory. In case both IDs are sent, anonymousId will be ignored.

No

eventName

String

Name of the event

No

eventTime

String

Date and time when the event occurred in ISO format: yyyy-MM-ddTHH:mm:ss±hhmm

No

eventData

String

Event attributes as key-value pairs. For example
{ "Product ID": 1337, "Category": "PERFUMES" }
These data types are allowed for custom attributes: String, Number, Boolean, Date, JSON Array, JSON Object. JSON Object can contain one of these data types.

No

gender

String

Gender of the user.
Can be one of male, female or other.

No

email

String

Email address of the user.

No

emailOptIn

Boolean

Email subscription preference of the user.
Users who are opted out of this will not receive any communication over email. Users are by default opted in to email.

No

phone

String

Phone number of the user.
phone must be in E.164 format, eg. +551155256325, +917850009678

No

smsOptIn

Boolean

SMS subscription preference for the user. Users who are opted out of this will not receive any communication over SMS. Users are by default opted in to SMS.

No

company

String

Name of the company for which the user works.

No

hashedEmail

String

Encrypted email address for use with a private Email Service Provider..

No

hashedPhone

String

Encrypted phone number for use with a private SMS Service Provider

No

attributes

Object

Custom attributes of the user as key-value pairs or arrays. For example:
{ "isPaidUser": true, "userPlan": "Premium" }
These data types are allowed for custom attributes: String, Number, Boolean, Date, JSON Object. JSON Object can contain one of these data types.

No

RETURNS:

While you call an API for receiving and sending data to track the custom events, you can be shown the below response. The status can be shown as queued, error, or success.

{
    "response": {
        "status": "queued"
    }
}

ERRORS :

If you do not pass the necessary information in the event attributes, then an error message will be displayed :

{
  "response": {
  "message":"Error: userId and anonymousId cannot be empty.",
  "status":"error"
    }
}