Methods
In the code, use AppMetrica.Instance
for accessing AppMetrica.
- Activating the plugin
-
void ActivateWithConfiguration(YandexAppMetricaConfig config); event ConfigUpdateHandler OnActivation; YandexAppMetricaConfig? ActivationConfig { get; }
- Requesting IDFA access
-
void RequestTrackingAuthorization(Action<YandexAppMetricaRequestTrackingStatus> action);
- Event tracking
-
void ReportEvent(string message); void ReportEvent(string message, string json); void ReportEvent(string message, Dictionary<string, object> parameters);
- Crash and error tracking
-
[Obsolete("The method is deprecated. Use ReportError(Exception exception, string condition)")] void ReportError([NotNull] string condition, [CanBeNull] string stackTrace); [Obsolete("The method is deprecated. Use ReportError(string groupIdentifier, string condition, Exception exception)")] void ReportError([NotNull] string groupIdentifier, [CanBeNull] string condition, [CanBeNull] string stackTrace); void ReportError([NotNull] string groupIdentifier, [CanBeNull] string condition, [CanBeNull] Exception exception); void ReportError([NotNull] Exception exception, [CanBeNull] string condition); void ReportUnhandledException([NotNull] Exception exception); void ReportErrorFromLogCallback([NotNull] string condition, [CanBeNull] string stackTrace);
- Monitoring sessions
-
void ResumeSession(); void PauseSession();
- AppMetrica settings
-
void SetLocationTracking(bool enabled); void SetLocation(YandexAppMetricaConfig.Coordinates? coordinates); void SetUserProfileID(string userProfileID);
- Sending Revenue
-
void ReportRevenue(YandexAppMetricaRevenue revenue);
- Sending AdRevenue
-
void ReportAdRevenue(YandexAppMetricaAdRevenue adRevenue);
- Sending user profiles
-
void ReportUserProfile(YandexAppMetricaUserProfile userProfile);
- Sending the referral URL of the app install
-
void ReportReferralUrl (string referralUrl);
- Sending a message about opening the app using a deeplink
-
void ReportAppOpen (string deeplink);
- Disabling sending statistics
-
void SetStatisticsSending(bool enabled);
- Force sending events from the buffer
-
void SendEventsBuffer();
- Getting the AppMetrica ID
-
void RequestAppMetricaDeviceID(Action<string, YandexAppMetricaRequestDeviceIDError?> action);
- Information about the version of AppMetrica used
-
int LibraryApiLevel { get; } string LibraryVersion { get; }
- Setting the error environment
-
void PutErrorEnvironmentValue(string key, string value);
- YandexAppMetricaAdRevenue class
-
YandexAppMetricaAdRevenue(long adRevenueMicros, [NotNull] string currency) YandexAppMetricaAdRevenue(double adRevenue, [NotNull] string currency) YandexAppMetricaAdRevenue(decimal adRevenue, [NotNull] string currency) decimal AdRevenue { get; private set; } [NotNull] string Currency { get; private set; } AdTypeEnum? AdType { get; set; } [CanBeNull] string AdNetwork { get; set; } [CanBeNull] string AdUnitId { get; set; } [CanBeNull] string AdUnitName { get; set; } [CanBeNull] string AdPlacementId { get; set; } [CanBeNull] string AdPlacementName { get; set; } [CanBeNull] string Precision { get; set; } [CanBeNull] IDictionary<string, string> Payload { get; set; }
- YandexAppMetricaConfig class
-
YandexAppMetricaConfig(string apiKey); string ApiKey { get; private set; } string AppVersion { get; set; } Coordinates? Location { get; set; } int? SessionTimeout { get; set; } bool? CrashReporting { get; set; } bool? LocationTracking { get; set; } bool? Logs { get; set; } bool? HandleFirstActivationAsUpdate { get; set; } YandexAppMetricaPreloadInfo? PreloadInfo { get; set; } bool? RevenueAutoTrackingEnabled { get; set; } bool? StatisticsSending { get; set; } bool? AppForKids { get; set; }
- YandexAppMetricaConfig.Coordinates class
-
double Latitude { get; set; } double Longitude { get; set; }
- YandexAppMetricaPreloadInfo class
-
YandexAppMetricaPreloadInfo(string trackingId); tring TrackingId { get; private set; } Dictionary<string, string> AdditionalInfo { get; private set; }
- YandexAppMetricaRevenue class
-
[Obsolete("The constructor is deprecated. Use YandexAppMetricaRevenue(decimal priceDecimal, string currency)")] YandexAppMetricaRevenue(double price, string currency); YandexAppMetricaRevenue(decimal priceDecimal, string currency) [Obsolete("The property is deprecated. Use PriceMicros.")] double? Price { get; private set; } decimal? PriceDecimal { get; private set; } int? Quantity { get; set; } string Currency { get; private set; } string ProductID { get; set; } YandexAppMetricaReceipt? Receipt { get; set; } string Payload { get; set; }
- YandexAppMetricaReceipt class
-
string Data { get; set; } string Signature { get; set; } string TransactionID { get; set; }
- YandexAppMetricaUserProfile class
-
List<YandexAppMetricaUserProfileUpdate> GetUserProfileUpdates(); YandexAppMetricaUserProfile Apply(YandexAppMetricaUserProfileUpdate update); YandexAppMetricaUserProfile ApplyFromArray(List<YandexAppMetricaUserProfileUpdate> updates);
- YandexAppMetricaAttribute class
-
static YandexAppMetricaBirthDateAttribute BirthDate(); static YandexAppMetricaGenderAttribute Gender(); static YandexAppMetricaNameAttribute Name(); static YandexAppMetricaNotificationsEnabledAttribute NotificationsEnabled(); static YandexAppMetricaBooleanAttribute CustomBoolean(string key); static YandexAppMetricaCounterAttribute CustomCounter(string key); static YandexAppMetricaNumberAttribute CustomNumber(string key); static YandexAppMetricaStringAttribute CustomString(string key);
- YandexAppMetricaBirthDateAttribute class
-
YandexAppMetricaUserProfileUpdate WithAge(int age); YandexAppMetricaUserProfileUpdate WithBirthDate(DateTime date); YandexAppMetricaUserProfileUpdate WithBirthDate(int year); YandexAppMetricaUserProfileUpdate WithBirthDate(int year, int month); YandexAppMetricaUserProfileUpdate WithBirthDate(int year, int month, int day); YandexAppMetricaUserProfileUpdate WithValueReset();
- YandexAppMetricaBooleanAttribute class
-
YandexAppMetricaUserProfileUpdate WithValue(bool value); YandexAppMetricaUserProfileUpdate WithValueIfUndefined(bool value); YandexAppMetricaUserProfileUpdate WithValueReset();
- YandexAppMetricaCounterAttribute class
-
YandexAppMetricaUserProfileUpdate WithDelta(double value);
- YandexAppMetricaGenderAttribute class
-
YandexAppMetricaUserProfileUpdate WithValue(Gender value); YandexAppMetricaUserProfileUpdate WithValueReset();
- YandexAppMetricaNameAttribute class
-
YandexAppMetricaUserProfileUpdate WithValue(string value); YandexAppMetricaUserProfileUpdate WithValueReset();
- YandexAppMetricaNotificationsEnabledAttribute class
-
YandexAppMetricaUserProfileUpdate WithValue(bool value); YandexAppMetricaUserProfileUpdate WithValueReset();
- YandexAppMetricaNumberAttribute class
-
YandexAppMetricaUserProfileUpdate WithValue(double value); YandexAppMetricaUserProfileUpdate WithValueIfUndefined(double value); YandexAppMetricaUserProfileUpdate WithValueReset();
- YandexAppMetricaStringAttribute class
-
YandexAppMetricaUserProfileUpdate WithValue(string value); YandexAppMetricaUserProfileUpdate WithValueIfUndefined(string value); YandexAppMetricaUserProfileUpdate WithValueReset();
- YandexAppMetricaAdRevenue.AdTypeEnum enumeration
-
Native, Banner, Rewarded, Interstitial, Mrec, Other
For more information about API methods and AppMetrica integration to the application, see the documentation for Android and iOS.