---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.4
alternate:
  - https://yandex.com/support/appmetrica-io/en/sdk/unity/analytics/methods.md
  - https://yandex.com/support/appmetrica-io/ru/sdk/unity/analytics/methods.md
  - https://yandex.com/support/appmetrica-io/zh/sdk/unity/analytics/methods.md
  - href: https://yandex.com/support/appmetrica-io/zh/sdk/unity/analytics/methods.md
    type: text/markdown
    title: Markdown version
  - href: https://yandex.com/support/appmetrica-io/zh/llms.txt?revision=r21687218
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/support/appmetrica-io/zh/llms.txt?revision=r21687218

# Methods

在代码中，使用 `Io.AppMetrica.AppMetrica` 类的静态方法来访问 AppMetrica。

要查看详细信息和方法参考，请前往[GitHub](https://github.com/appmetrica/appmetrica-unity-plugin/blob/main/Runtime/AppMetrica.cs)。

<!-- ## Активация плагина

```csharp translate=no
void Activate([NotNull] AppMetricaConfig config);
```

## Отслеживание событий

```csharp translate=no
void ReportEvent([NotNull] string message);
void ReportEvent([NotNull] string message, [CanBeNull] string json);
```

## Отслеживание крэшей и ошибок

```csharp translate=no
void ReportError([NotNull] string message, [NotNull] Exception exception);
void ReportError([NotNull] string identifier, [CanBeNull] string message, [CanBeNull] Exception exception);
void ReportUnhandledException([NotNull] Exception exception);
```

## Отслеживание сессий

```csharp translate=no
void ResumeSession();
void PauseSession();
```

## Настройки AppMetrica

```csharp translate=no
void SetLocationTracking(bool enabled);
void SetLocation([CanBeNull] Location coordinates);
void SetUserProfileID([CanBeNull] string userProfileID);
```

## Отправка Revenue

```csharp translate=no
void ReportRevenue([NotNull] Revenue revenue);
```

## Отправка AdRevenue

```csharp translate=no
void ReportAdRevenue([NotNull] AdRevenue adRevenue);
```

## Отправка пользовательских профилей

```csharp translate=no
void ReportUserProfile([NotNull] UserProfile userProfile);
```

## Отправка сообщения об открытии приложения с помощью deeplink

```csharp translate=no
void ReportAppOpen([NotNull] string deeplink);
```

## Отключение отправки статистики

```csharp translate=no
void SetDataSendingEnabled(bool enabled);
```

## Принудительная отправка событий из буфера

```csharp translate=no
void SendEventsBuffer();
```

## Получение идентификаторов AppMetrica

```csharp translate=no
void RequestStartupParams([NotNull] StartupParamsDelegate action, [NotNull] IEnumerable<string> identifiers);
```

## Информация об используемой версии AppMetrica

```csharp translate=no
string GetLibraryVersion();
```

## Установка окружения ошибки

```csharp translate=no
void PutErrorEnvironmentValue([NotNull] string key, [CanBeNull] string value);
```

## См. также

- [Как включить отправку данных о местоположении пользователей?](https://yandex.com/support/appmetrica-io/zh/troubleshooting/troubleshooting.md)

-->

<!-- source: zh/_includes/feedback-button-3.md -->
如果您没有找到所需答案，可以通过反馈表单提交您的问题。 请尽可能详细地描述问题。 如果可能，请附上截图。

<a href="../troubleshooting/feedback-new">
  <span class="button">联系支持</span>
</a>

<a href="../troubleshooting/feedback-docs">
  <span class="button">为文档提出改进建议</span>
</a>
<!-- endsource: zh/_includes/feedback-button-3.md -->
