-
Notifications
You must be signed in to change notification settings - Fork 2
Analytics API
levching edited this page Apr 14, 2020
·
2 revisions
First of all, you need to Initialize an Analytics client as early as possible on app launch.
using SA.CrossPlatform.Analytics;
...
UM_AnalyticsService.Client.Init();Once it's initialized you can now an analytics data using the following API:
Send Event:
/// <summary>
/// Send an analytics event.
/// </summary>
/// <param name="eventName">custom event name</param>
void Event(string eventName);
/// <summary>
/// Send an analytics event.
/// </summary>
/// <param name="eventName">custom event name</param>
/// <param name="data">custom event data</param>
void Event(string eventName, IDictionary<string, object> data);Monetization Tracking:
/// <summary>
/// Tracking Monetization (optional).
/// </summary>
/// <param name="productId">The id of the purchased item.</param>
/// <param name="amount">The price of the item.</param>
/// <param name="currency">
/// Abbreviation of the currency used for the transaction. For example “USD” (United
/// States Dollars). See http:en.wikipedia.orgwikiISO_4217 for a standardized list
/// of currency abbreviations.
/// </param>
void Transaction(string productId, float amount, string currency);User Demographics:
/// <summary>
/// User Demographics (optional).
/// </summary>
/// <param name="userId">User unique id</param>
void SetUserId(string userId);
/// <summary>
/// User Demographics (optional).
/// </summary>
/// <param name="birthYear">Birth year of user. Must be 4-digit year format, only.</param>
void SetUserBirthYear(int birthYear);
/// <summary>
/// User Demographics (optional).
/// </summary>
/// <param name="gender">Gender of a user</param>
void SetUserGender(UM_Gender gender);Reliable and high-quality Unity Development service. Let's Talk!
Website | AssetStore | LinkedIn | Youtube | Scripting Reference
- Application
- Dark Mode
- Native Dialogs
- Native Preloader
- Date Picker Dialog
- Time Picker Dialog
- Rate Us Dialog
- Build Info
- Locale
- Permissions
- Wheel Picker Dialog
- Getting Started
- Connecting to The Service
- Purchase flow
- Transactions Validation
- Test Inside the Editor
- Advanced use cases
- Getting Started
- Enabling the Ads Service
- Banner Ads
- Non-rewarded Ads
- Rewarded Ads
- Unity Ads
- Google AdMob
- Chartboost
- Getting Started
- Analytics API
- Automatic Tracking
- Unity Analytics
- Firebase Analytics
- Facebook Analytics