Send and Track Events

This document will cover the method to send event to Suprsend platform

In this section, we'll cover how to send events to the Suprsend platform from your web application

Pre-requisites

  1. Integrate Javascript SDK
  2. Create User Profile
  3. Create Template on SuprSend platform - if you want to trigger workflow by passing the event
  4. Create Workflow on SuprSend Platform - if you want to trigger workflow by passing the event

Create Workflow on SuprSend Platform

For Event based workflow trigger, you'll have to create the workflow on SuprSend Platform.

577

Sending Events to SuprSend

Once the workflow is configured, you can pass the Event Name ( GROCERY_PURCHASED in above example) defined in workflow configuration from your SDK and the related workflow will be triggered. Variables added in the template should be passed as event properties

You can send Events from your app to SuprSend platform by using suprsend.track() method

//method
suprsend.track(event_name, property_obj);

//Example
suprsend.track("clicked", {"page":"Dashboard"});
ParametersTypeDescription
event_namestring (required)Name of the tracked event
property_objobject (optional)Additional data related to the event (event properties) can be tracked using this field.

❗️

Naming Guideline

When you create an Event or a property, please ensure that the Event Name or Property Name does not start with $ or ss_, as we have reserved these symbols for our internal events and property names.


System Events tracked by SuprSend

There are some system events tracked by SuprSend SDK by default. These are some basic events, as well as events that are necessary for tracking notifications related activity (like delivered, clicked, etc).
You are not required to do anything here.

Event NameDescription
$user_loginGets tracked when user logs in
$user_logoutGets tracked when user logs out
$notification_deliveredWill get tracked when the suprsend notification payload is received at sdk end.
$notification_clickedWill get tracked when user either clicks the notification body or any action button in the notification.

Advanced Concepts

1. Super Properties

Super properties are data that are always sent with events data. These super properties will be sent in each event after calling this method. Super properties will be stored in local storage, and will persist across invocations of app.

Set Super Property

There are some super properties that SuprSend SDK will send by default. Developer can set custom super properties as well with suprsend.set_super_properties() method

//method
suprsend.set_super_properties(property_obj);

//Example
suprsend.set_super_properties({ "gender" : "male" });

Default Super properties tracked by SuprSend SDK:

Super PropertyDescriptionSample Value
$browserBrowser of the userChrome
$browser_versionBrowser version of the user96.0
$current_urlThe URL from which the event is triggeredhttps://www.suprsend.com/blog
$deviceIdDevice id89eead05a0150146
$osOperating System of the deviceMac OS
$sdk_typeinternal to SuprSendBrowser
$sdk_versioninternal to SuprSend0.1.14