1. Home
  2. Integrations
  3. Android Unity Events Setup Guide
  4. Social Applications – Android Unity

Social Applications – Android Unity

We have provided a list of Events with their example usage that can be integrated for Social Applications. Please find them below:

1. Paid Subscription Deactivated Event

This is used to track when the User has unsubscribed from any of the services of the Social Application.

You will need to call the below method to track the Subscription Deactivated event in your Application.

Java

public static void TrackPaidSubscriptionDeactivated
(string userID, Dictionary<string, object> extraParams);

 

  • Mandatory parameters (Paid Subscription Deactivated):                           
    • User Id -Unique User Identifier
  • Optional parameters (Product):                          
    • Page Name -Page that triggered the Event
    • Location  – Geolocation of the Event

 

Sample Code

Dictionary<string, object> extrasParams = new Dictionary<string, object> ();
       extrasParams.Add (EventConstant.PAGE_NAME, “My Account”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, -118.144516);

       MTractionTracker.TrackPaidSubscriptionDeactivated (“123”, extrasParams);

2. Profile Updated Event

This is used to track the event triggered when the user has updated his profile information on the Application.

You will need to call the below method to track the Profile Updation event in your Application.

Java

public static void TrackProfileUpdated
(string userID, string category, Dictionary<string, object> extraParams);

 

  • Mandatory parameters (Profile Updated):                            
    • User Id – Unique User Identifier
    • Category -Category/Section of the profile update
  • Optional parameters (Profile Updated):                            
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event

Sample Code

Dictionary<string, object> extrasParams = new Dictionary<string, object> ();
       extrasParams.Add (EventConstant.PAGE_NAME, “My Account”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, -118.144516);

       MTractionTracker.TrackProfileUpdated (“123”, “Personal Section”, extrasParams);

3. Friends Added Event

This is used to track the event triggered when the user has added a new friend to his list on the Application.

You will need to call the below method to track the Friends added event in your Application.

Java

public static void TrackFriendsAdded
(string userID, Dictionary<string, object> extraParams);

 

  • Mandatory parameters (Friends Added):                            
    • User Id – Unique User Identifier
  • Optional parameters (Friends Added):                           
    • Gender- MALE or FEMALE based on the sex of the person, being added as a friend
    • Age – Age of the person being added
    • Pagename – Page that triggered the Event
    • Location – Geolocation of the Event
    • Description – Event Description

Sample Code

Dictionary<string, object> extrasParams = new Dictionary<string, object> ();
       extrasParams.Add (EventConstant.GENDER, MTraction.Gender.FEMALE);
       extrasParams.Add (EventConstant.AGE, 27);
       extrasParams.Add (EventConstant.PAGE_NAME, “Recommended Friends”);
       extrasParams.Add (EventConstant.DESCRIPTION, “Friend request sent to id: 567”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, -118.144516);

       MTractionTracker.TrackFriendsAdded (“123”, extrasParams);

4. Chatted Event

This is used to track the private or group chat event initiated by the user to other user(s) on the Application.

You will need to call the below method to track the Chatted event in your Application.

Java

public static void TrackChatted
(string userIDFrom, string userIDTo, Dictionary<string, object> extraParams);

 

  • Mandatory parameters (Chatted):                            
    • User Id From – Unique Identifier of the User who initiated the Chat
    • User Id To  – Unique Identifier of the User who received the Chat
  • Optional parameters (Chatted):                            
    • Chat Type –  DIRECT_CHAT or GROUP_CHAT
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event

Sample Code

Dictionary<string, object> extrasParams = new Dictionary<string, object> ();
       extrasParams.Add (EventConstant.PAGE_NAME, “Private Chat”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, -118.144516);

       MTractionTracker.TrackChatted (“123”, “567”, MTraction.ChatType.DIRECT_CHAT, extrasParams);

5. New Group Created Event

This is used to track the event triggered when an user has created a group in your Application.

You will need to call the below method to track the Group Created event in your Application.

Java

public static void TrackNewGroupCreated
(string userID, Dictionary<string, object> extraParams);

 

  • Mandatory parameters (New Group Created):                            
    • User Id – Unique User Identifier
  • Optional parameters (New Group Created):                            
    • Quantity – Size of the Group created
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event

Sample Code

Dictionary<string, object> extrasParams = new Dictionary<string, object> ();
       extrasParams.Add (EventConstant.QUANTITY, 50);
       extrasParams.Add (EventConstant.PAGE_NAME, “Create group”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, -118.144516);

       MTractionTracker.TrackNewGroupCreated (“123”, extrasParams);

6. Call Placed Event

This is used to track the call event initiated by an user to another user on the Application.

You will need to call the below method to track the Call Placed event in your Application.

public static void TrackCallPlaced
(string userIDFrom, string userIDTo, Dictionary
<string, object> extraParams);

  • Mandatory parameters (Call Placed Item):                            
    • User Id From – Unique Identifier of the User who initiated the Call
    • User Id To – Unique Identifier of the User who received the Call
  • Optional parameters (Call Placed Item):                            
    • Pagename – Page that triggered the Event
    • Location – Geolocation of the Event

Sample Code

Dictionary<string, object> extrasParams = new Dictionary<string, object> ();
       extrasParams.Add (EventConstant.PAGE_NAME, “Contact List”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, -118.144516);

       MTractionTracker.TrackCallPlaced (“123456789”, “87654321”, extrasParams);

7.Add to playlist Event

This is used to track the playlist initiated by an user on the Application.

You will need to call the below method to track the Add To Playlist event in your Application.

Java

public static void TrackAddToPlaylist
(string listName, string identifier, Dictionary<string, Dictionary
<string, object>> playList, Dictionary<string, object> extraParamsDic);

 

// PlayList Array Definition

Dictionary<string, Dictionary<string, object>>
playLists = new Dictionary<string, Dictionary<string, object>> ();

 

// PlayList Item Array Definition

HTML

Dictionary<string, object> playList1 = new Dictionary<string, object> ();

 

  • Mandatory parameters (Add to playlist):                            
    • Product Name – Name of the Social Product
    • Identifier  -Unique Identifier of the playlist.
  • Optional parameters (Add to playlist):                            
    • Brand – Brand Name of the Product
    • Artist  – Artist of playlist
    • Category  – Product Category

 

// How to create Playlist Array

HTML

Dictionary<string, Dictionary<string, object>> playLists = new Dictionary<string, Dictionary<string, object>> ();
Dictionary<string, object> playList1 = new Dictionary<string, object> ();
Dictionary<string, object> playList2 = new Dictionary<string, object> ();

 

// Adding the items to the PlayList Array

HTML

playLists.Add ((EventConstant.PLAYLIST_ITEM + “1”), playList1);
playLists.Add ((EventConstant.PLAYLIST_ITEM + “2”), playList2);

Note :: Add items to the list by concatenation of incremental value with PLAYLIST_ITEM constant as shown in above example.

 

  • Mandatory parameters (Add to playlist):                            
    • Playlist Name – Unique User Playlist Name.
    • Identifier  -Unique Identifier of the playlist.
    • ProductItemList  – Item list of product.
  • Optional parameters (Add to playlist):                            
    • Pagename – Page that triggered the Event
    • Location – Geolocation of the Event

AddToPlaylist Item List’s  Pre-defined parameters for tracking product data on our system.

 

 Dictionary<string, Dictionary<string, object>> playLists = new Dictionary<string, Dictionary<string, Dictionary<string, object>> playLists = new Dictionary<string, Dictionary<string, object>> ();
       Dictionary<string, object> playList1 = new Dictionary<string, object> ();        playList1.Add (EventConstant.PRODUCT_NAME, “K3G”);
       playList1.Add (EventConstant.IDENTIFIER, “id123”);
       playList1.Add (EventConstant.BRAND, “Movie”); // Optional parameter
       playList1.Add (EventConstant.CATEGORY, “Bollywood”); // Optional parameter
       playList1.Add (EventConstant.ARTIST, “Sonu Nigam”); // Optional parameter     
       playLists.Add ((EventConstant.PLAYLIST_ITEM + “1”), playList1);
       Dictionary<string, object> extrasParams = new Dictionary<string, object> ();
       extrasParams.Add (EventConstant.PAGE_NAME, “Play_list”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, -118.144516);
       MTractionTracker.TrackAddToPlaylist (“MyFavPlaylist”, “id789”, playLists, extrasParams);

 

 

Was this article helpful to you? Yes No

How can we help?