Answers Events

Answers Events gives you the ability to track the specific actions and events in your Unity app that matter most. You can now see how users are behaving in your app and surfacing that critical information in real-time. There are a set of core events that developers let us know that they wanted to track in addition to the existing Answers’ metrics, so we built out a set of events such as “Content Viewed”, “Purchase”, or “Level Start”, in addition to many others that you can find below. All of the events have a number of optional, but recommended parameters, to help you better understand your user’s behavior within your app.

We also realize that every app has their own unique user actions to track, which you can do using custom events. We also realize that every app has their own unique user actions to track, which you can do using custom events. Answers can track a maximum of 3,000 distinct events per app. For example, LogPurchase and logStartCheckout would be two of your 3,000 events. However, each of those events can be logged without any limits.

The following events should be added in your Unity C# scripts.

Purchase

Implementing a Purchase event allows you to see your revenue in real-time, understand how many users are making purchases, see which items are most popular, and track plenty of other important purchase-related metrics.

Answers.LogPurchase (
  decimal? price = null,
  string currency = null,
  bool? success = null,
  string itemName = null,
  string itemType = null,
  string itemId = null,
  Dictionary<string, object> customAttributes = null
);

Add to Cart

Implementing an Add to Cart event allows you to see users adding items to a shopping cart in real-time, understand how many users start the purchase flow, see which items are most popular, and track plenty of other important purchase-related metrics.

Answers.LogAddToCart (
  decimal? itemPrice = null,
  string currency = null,
  string itemName = null,
  string itemType = null,
  string itemId = null,
  Dictionary<string, object> customAttributes = null
);

Recommended Attributes

We recommend including the following attributes to get a better understanding of your users’ activity related to adding items to a shopping cart within your app. These are all optional, and included in the example above.

  • itemPrice The item’s amount in the currency specified
  • currency The ISO4217 currency code
  • itemName The human-readable name for the item
  • itemType The category the item falls under
  • itemId A unique identifier used to track the item

Start Checkout

Implementing a Start Checkout event allows you to see users moving through the purchase funnel in real-time, understand how many users are doing this and how much they’re spending per checkout, and see how it related to other important purchase-related metrics.

Answers.LogStartCheckout (
  decimal? totalPrice = null,
  string currency = null,
  int? itemCount = null,
  Dictionary<string, object> customAttributes = null
);

Recommended Attributes

We recommend including the following attributes to get a better understanding of your users’ activity related to starting checkout within your app. These are all optional, and included in the example above.

  • totalPrice The total price of all items in cart in the currency specified
  • currency The ISO4217 currency code
  • itemCount The count of items in cart

Content View

Implementing a Content View event allows you to see users viewing content within your app in real-time and understand what content is most engaging, from the type or genre down to the specific id.

Answers.LogContentView (
  string contentName = null,
  string contentType = null,
  string contentId = null,
  Dictionary<string, object> customAttributes = null
);

Recommended Attributes

We recommend including the following attributes to get a better understanding of your users’ activity related to viewing content within your app. These are all optional, and included in the example above.

  • contentName The Human-readable name of content
  • contentType The category your item falls under
  • contentId A unique identifier used to track the item

Share

Implementing a Share event allows you to see users sharing from your app in real-time, letting you understand what content they’re sharing from the type or genre down to the specific id.

Answers.LogShare (
  string method = null,
  string contentName = null,
  string contentType = null,
  string contentId = null,
  Dictionary<string, object> customAttributes = null
);

Recommended Attributes

We recommend including the following attributes to get a better understanding of your users’ activity related to sharing. These are all optional, and included in the example above.

  • method The method used to share content
  • contentName The description of the content
  • contentType The type or genre of content
  • contentId A unique key identifying the content

Rated Content

Implementing a Rated Content event allows you to see users rating content within your app in real-time and understand what content is most engaging, from the type or genre down to the specific id.

Answers.LogRating (
  int? rating = null,
  string contentName = null,
  string contentType = null,
  string contentId = null,
  Dictionary<string, object> customAttributes = null
);

Recommended Attributes

We recommend including the following attributes to get a better understanding of your users’ activity related to rating content within your app. These are all optional, and included in the example above.

  • rating An integer rating of the content
  • contentName The human-readable name of content
  • contentType The category your item falls under
  • contentId A unique identifier used to track the item

Sign Up

Implementing a Sign Up event allows you to see users signing up for your app in real-time, understand how many users are signing up with different methods and their success rate signing up.

Answers.LogSignUp (
  string method = null,
  bool? success = null,
  Dictionary<string, object> customAttributes = null
);

Recommended Attributes

We recommend including the following attributes to get a better understanding of your users’ activity related to sign up. These are all optional, and included in the example above.

  • method The method used to sign up
  • success Whether sign up succeeded or failed

Log In

Implementing a Log In event allows you to see users logging into your app in real-time, understand how many users are logging in with different methods and their success rate logging into your app.

Answers.LogLogin (
  string method = null,
  bool? success = null,
  Dictionary<string, object> customAttributes = null
);

Recommended Attributes

We recommend including the following attributes to get a better understanding of your users’ activity related to login. These are all optional, and included in the example above.

  • method The method used to sign up
  • success Whether sign up succeeded or failed

Invite

Implementing an Invite event allows you to see existing users inviting other users and growing your user base in real-time, letting you understand which methods are the most successful.

Answers.LogInvite (
  string method = null,
  Dictionary<string, object> customAttributes = null
);

Recommended Attributes

We recommend including the following attributes to get a better understanding of your users’ activity related to inviting other users. These are all optional, and included in the example above.

  • method The method used to invite the user

Level Start

Implementing an Level Start event allows you to see users starting levels in real-time, letting you understand which levels see the most action.

Answers.LogLevelStart (
  string level = null,
  Dictionary<string, object> customAttributes = null
);

Recommended Attributes

We recommend including the following attributes to get a better understanding of your users’ activity related to starting levels within your app. These are all optional, and included in the example above.

  • level String key describing the level

Level End

Implementing a Level End event allows you to see users finishing levels in real-time, letting you understand which levels see the most action, and see the scores users are achieving.

Answers.LogLevelEnd (
  string level = null,
  double? score = null,
  bool? success = null,
  Dictionary<string, object> customAttributes = null
);

Recommended Attributes

We recommend including the following attributes to get a better understanding of your users’ activity related to finishing levels within your app. These are all optional, and included in the example above.

  • level The string key describing the level
  • score The score for this level
  • success Completed the level or failed trying

Custom Event

To log a custom event to be sent to Answers, use the following:

Answers.LogCustom (
  string eventName,
  Dictionary<string, object> customAttributes = null
);

You can also include a series of custom attributes to get even deeper insight into what’s happening in your app.

Custom Attributes

In addition to the recommended attributes for each event, you can also add custom attributes for any event. To log an event with a custom attribute, use the following:

Answers.LogCustom(
  "Tweet Viewed",
  customAttributes: new Dictionary<string, object> (){
    {"Media Type", "Image"},
    {"Length", 123}
  }
);