Windows 8 - Event tracking

The R1 Connect SDK will automatically capture some generic events, but in order to get the most meaningful data on how users interact with your app the SDK also offers pre-built user-defined events for popular user actions as well as the ability to create your own custom events.

State Events

Some events are emitted automatically when the state of the application is changed by the OS and, therefore, they do not require any additional code to be written in the app in order to work out of the box:

Launch - emitted when the app starts

First Launch - emitted when the app starts for the first time

First Launch After Update - emitted when the app starts for the first time after a version upgrade

Suspend - emitted when the app is put into the background state

Resume - emitted when the app returns from the background state

Pre-Defined Events

Pre-Defined Events are also helpful in measuring certain metrics within the apps and do not require further developer input to function. These particular events below are used to help measure app open events and track Sessions.

Application Opened - This event is very useful for push notifications and can measure when your app is opened after a message is sent.

Session Start - As the name implies the Session Start event is used to start a session.

Session End - The Session End event is used to end a session and passes with it a Session Length attribute that calculates the session length in seconds.

User-Defined Events

User-Defined Events are not sent automatically so it is up to you if you want to use them or not. They can provide some great insights on popular user actions if you decide to track them. In order to set this up the application code needs to include the emitter callbacks in order to emit these events.

Note: The last argument in all of the following emitter methods, otherInfo, is an optional dictionary of “key”,”value” pairs or null

Login

Tracks a user login within the app

var otherInfo = new Dictionary<string, object>();
otherInfo.Add("custom_key", "value");

Radiumone.Connect.Emitter.Instance.EmitLogin("userId", "user_name", otherInfo);

User Info

Records an user information

var userInfo = new Radiumone.Connect.EmitterInfo.UserInfo();
userInfo.UserID = "userID";
userInfo.UserName = "userName";
userInfo.Email = "email";
userInfo.FirstName = "firstName";
userInfo.LastName = "lastName";
userInfo.City = "city";
userInfo.Phone = "phone";
userInfo.State = "state";
userInfo.StreetAddress = "streetAddress";
userInfo.Zip = "zip";

var otherInfo = new Dictionary<string, object>();
otherInfo.Add("custom_key", "value");

Radiumone.Connect.Emitter.Instance.EmitUserInfo(userInfo, otherInfo);

Registration

Records a user registration within the app

var otherInfo = new Dictionary<string, object>();
otherInfo.Add("custom_key", "value");

Radiumone.Connect.Emitter.Instance.EmitRegistration("userId", "userName", "country", "state", "city", otherInfo);

Facebook connect

Allows access to Facebook services

var socialPermissions = new List<Radiumone.Connect.EmitterInfo.SocialPermission>();
socialPermissions.Add(new Radiumone.Connect.EmitterInfo.SocialPermission("photos", YES));

var otherInfo = new Dictionary<string, object>();
otherInfo.Add("custom_key", "value");

Radiumone.Connect.Emitter.Instance.EmitFBConnect(socialPermissions, otherInfo);

Twitter connect

Allows access to Twitter services

var socialPermissions = new List<Radiumone.Connect.EmitterInfo.SocialPermission>();
socialPermissions.Add(new Radiumone.Connect.EmitterInfo.SocialPermission("photos", YES));

var otherInfo = new Dictionary<string, object>();
otherInfo.Add("custom_key", "value");

Radiumone.Connect.Emitter.Instance.EmitTConnect("12345", "user_name", socialPermissions, otherInfo);

Upgrade

Tracks an application version upgrade

var otherInfo = new Dictionary<string, object>();
otherInfo.Add("custom_key", "value");

Radiumone.Connect.Emitter.Instance.EmitUpgrade(otherInfo);

Trial Upgrade

Tracks an application upgrade from a trial version to a full version

var otherInfo = new Dictionary<string, object>();
otherInfo.Add("custom_key", "value");

Radiumone.Connect.Emitter.Instance.EmitTrialUpgrade(otherInfo);

Screen View

Basically, a page view, it provides info about that screen

var otherInfo = new Dictionary<string, object>();
otherInfo.Add("custom_key", "value");

Radiumone.Connect.Emitter.Instance.EmitScreenView("title",
                                "description",
                                "http://www.example.com/path",
                                "example.com",
                                "path",
                                otherInfo);

E-Commerce Events

Transaction

var otherInfo = new Dictionary<string, object>();
otherInfo.Add("custom_key", "value");

Radiumone.Connect.Emitter.Instance.EmitTransaction("transaction_id", "store_id", "store_name", "cart_id", "order_id", 1.5, "USD", 10.5, 12.0, otherInfo);

TransactionItem

var lineItem = new Radiumone.Connect.EmitterInfo.LineItem();

lineItem.ProductID = "product_id";
lineItem.ProductName = "product_name";
lineItem.Quantity = 5;
lineItem.UnitOfMeasure = "unit";
lineItem.MsrPrice = 10;
lineItem.PricePaid = 10;
lineItem.Currency = "USD";
lineItem.ItemCategory = "category";

var otherInfo = new Dictionary<string, object>();
otherInfo.Add("custom_key", "value");

Radiumone.Connect.Emitter.Instance.EmitTransactionItem("transaction_id", lineItem, otherInfo);

Create Cart

var otherInfo = new Dictionary<string, object>();
otherInfo.Add("custom_key", "value");

Radiumone.Connect.Emitter.Instance.EmitCartCreate("cart_id", otherInfo);

Delete Cart

var otherInfo = new Dictionary<string, object>();
otherInfo.Add("custom_key", "value");

Radiumone.Connect.Emitter.Instance.EmitCartDelete("cart_id", otherInfo);

Add To Cart

var lineItem = new Radiumone.Connect.EmitterInfo.LineItem();

lineItem.ProductID = "product_id";
lineItem.ProductName = "product_name";
lineItem.Quantity = 5;
lineItem.UnitOfMeasure = "unit";
lineItem.MsrPrice = 10;
lineItem.PricePaid = 10;
lineItem.Currency = "USD";
lineItem.ItemCategory = "category";

var otherInfo = new Dictionary<string, object>();
otherInfo.Add("custom_key", "value");

Radiumone.Connect.Emitter.Instance.EmitAddToCart("cart_id", lineItem, otherInfo);

Delete From Cart

var lineItem = new Radiumone.Connect.EmitterInfo.LineItem();

lineItem.ProductID = "product_id";
lineItem.ProductName = "product_name";
lineItem.Quantity = 5;
lineItem.UnitOfMeasure = "unit";
lineItem.MsrPrice = 10;
lineItem.PricePaid = 10;
lineItem.Currency = "USD";
lineItem.ItemCategory = "category";

var otherInfo = new Dictionary<string, object>();
otherInfo.Add("custom_key", "value");

Radiumone.Connect.Emitter.Instance.EmitDeleteFromCart("cart_id", lineItem, otherInfo);

Custom Events

With custom events you have the ability to create and track specific events that are more closely aligned with your app. If planned and structured correctly, custom events can be strong indicators of user intent and behavior. Some examples include pressing the “like” button, playing a song, changing the screen mode from portrait to landscape, and zooming in or out of an image. These are all actions by the user that could be tracked with events.

To include tracking of custom events for the mobile app, the following callbacks need to be included in the application code:

// Emits a custom event without parameters
Radiumone.Connect.Emitter.Instance.EmitEvent("Your custom event name");

Or

// Emits a custom event with parameters
var otherInfo = new Dictionary<string, object>();

otherInfo.Add("custom_key", "value");

Radiumone.Connect.Emitter.Instance.EmitEvent("Your custom event name", otherInfo);
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk