---
metadata:
  - name: generator
    content: Diplodoc Platform v5.64.0
alternate:
  - https://boost.yandex.com/doc/en/analytics/content/mobile-tracking/tracking-specification.md
  - https://boost.yandex.com/doc/ru/analytics/content/mobile-tracking/tracking-specification.md
  - https://boost.yandex.com/doc/zh/analytics/content/mobile-tracking/tracking-specification.md
  - href: https://boost.yandex.com/doc/zh/analytics/content/mobile-tracking/tracking-specification.md
    type: text/markdown
    title: Markdown version
  - href: https://boost.yandex.com/doc/zh/llms.txt?revision=r21738064
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://boost.yandex.com/doc/zh/llms.txt?revision=r21738064

# 追踪 URL 的参数

此部分描述了Analytics module跟踪URL的结构和参数。

## 结构 {#structure}

```no-highlight translate=no
https://redirect|impression.appmetrica.yandex.com/serve/[tracking ID — The ID of the tracker]
```

使用 `redirect.appmetrica.yandex.com` 域名进行点击归因，使用 `impression.appmetrica.yandex.com` 域名进行展现归因。

Example:

```no-highlight translate=no
https://redirect.appmetrica.yandex.com/serve/1019409635088005254
```

`redirect.appmetrica.yandex.com` — 当前使用的主要域名。 Possible variations:

- `appmetrika.yandex.com`
- `appmetrica.yandex.ru`
- `appmetrika.yandex.ru`

跟踪 URL 可以包含预定义参数，这些参数是跟踪功能正常工作所必需的。 广告系统（Analytics module 合作伙伴）必须通过这些参数传递特定值。 为了简化这个过程，Analytics module 提供了各种媒体源的宏，用于替换参数。 例如：

Analytics module 存储 `macros-params`，对应 **合作伴侣 A**：

- `点击 ID — {transaction_id}`
- `Google 广告 ID — {GAID}`

生成的跟踪 URL 用于 **Partner A**：

```
https://redirect.appmetrica.yandex.com/serve/1019409635088005254?click_id={transaction_id}&google_aid={GAID}
```

用户必须将此跟踪 URL 提供给伙伴 A。跟踪将自动开始。

## 参数 {#params}

参数被分为三类：必需、推荐和可选。 请注意，S2S 调用有额外的参数。

### 必填 {#required-params}

`click_id={YOURMACRO}&` — 用于传输唯一`点击 ID`. 用于去重。

### 推荐 {#recommended-params}

用于更精确统计安装的参数。

`google_aid={YOURMACRO}&` — 来自设备的 Google AID，保持原始格式。

`google_aid_sha1={YOURMACRO}&` — SHA1 哈希值 of Google AID。

`google_aid_md5={YOURMACRO}&` — Google AID 的 MD5 哈希值。

`ios_ifa={YOURMACRO}&` — IFA 以从设备接收的格式显示。

`ios_ifa_sha1={YOURMACRO}&` — IFA 的 SHA1 哈希。

`ios_ifa_md5={YOURMACRO}&` — IFA 的 MD5 哈希。

`oaid = {YOURMACRO}&` — 华为 OAID，保持从设备获取的格式。

`oaid_sha1={YOURMACRO}&` — SHA1 哈希值，来自华为 OAID。

`oaid_md5={YOURMACRO}&` — Huawei OAID 的 MD5 哈希。

`windows_aid = {YOURMACRO}&` — Windows AID 以从设备接收的格式提供。

`windows_aid_sha1={YOURMACRO}&` — Windows AID 的 SHA1 哈希。

`windows_aid_md5={YOURMACRO}&` — Windows AID 的 MD5 哈希。

### S2S 调用的参数 {#s2s-params}

`device_ip={YOURMACRO}&` — 设备的URL编码IP地址。 IPv4 和 IPv6 都受支持。

`device_ua={YOURMACRO}&` — 设备的 URL 编码 User-Agent。

`click_timestamp={YOURMACRO}&` — UTC 点击时间戳，以秒为单位。

`noredirect={YOURMACRO}&` — 通知Analytics module点击应被计数，而不重定向到应用商店。 默认值为 1。

要了解有关 s2s 集成的更多信息，请参见[S2S 集成](https://boost.yandex.com/doc/zh/analytics/content/mobile-tracking/s2s.md)。

### 可选 {#optional-params}

用于优化广告投放的参数。 传输的参数以树形结构显示在[流量来源](https://boost.yandex.com/statistic?appId=1111&report=campaigns2&metrics=ym_m_advInstallDevicesFake&sampling=medium)报告中。

`afpub_id={YOURMACRO}&` — 伙伴出版商（子伙伴）的 ID。

`site_id={YOURMACRO}&` — 特定广告位的 ID。

`creative_id={YOURMACRO}&` — 特定广告牌的 ID。

`appmetrica_js_redirect=0&` — 禁用 JavaScript 重定向。

### 自定义参数 {#custom-params}

为了更好地优化广告投放，广告主和广告网络可以在跟踪 URL 中传输额外的参数。

要发送自定义参数，请将它们添加到跟踪 URL 中。 使用这些参数传输值有多种方式：

- 手动 — 输入参数值：

   ```
   custom_parameter=value&
   ```

- 自动 — 在广告网络侧使用宏来自动替换：

   ```
   示例参数={CUSTOM_MACRO}&
   ```


追踪 URL 中列出的所有参数都会以树形结构显示在 [流量来源](https://boost.yandex.com/statistic?appId=1111&report=campaigns2&metrics=ym_m_advInstallDevicesFake&sampling=medium) 报告中。

## 示例 {#examples}

你可以用这些示例进行测试——将宏替换为自己的。 根据需要删除任何不必要、不受支持或可选的参数。

**安卓**

```
https://redirect.appmetrica.yandex.com/serve/600573419754384676?click_id={transaction_id}&google_aid={google_aid}&afpub_id={affiliate_id}&custom_price={payout}
```

**iOS**

```
https://redirect.appmetrica.yandex.com/serve/528515824760210044?click_id={transaction_id}&ios_ifa={ios_ifa}&afpub_id={affiliate_id}&custom_price={payout}
```

## 将参数发送到postback URL、deeplink和目标URL {#passing-params}

要将跟踪 URL 中的参数值传递到 postback URL、deeplink 或目标 URL，请在它们的 URL 中用花括号添加参数名称：`{custom_parameter}`。 这种方式可以传递任何参数——自定义或预定义的。

{% note info "" %}

如果您使用[通用链接](https://boost.yandex.com/doc/zh/analytics/content/sdk/ios/analytics/ios-universal-links.md)作为跟踪 URL，参数会自动传递到深链。

{% endnote %}

参数传输示例：

{% cut "到目标 URL" %}

在追踪器设置中编辑目标 URL，以添加传输宏

例如，假设跟踪 URL 包含以下参数：

```
https://redirect.appmetrica.yandex.com/serve/123456?custom_parameter=value1&another_param=value2
```

要在目标 URL 中传递 `value1` 和 `value2`，请按以下方式编辑它：

```
https://endpoint.myadnetwork.com?some_parameter={custom_parameter}&another_param={another_param}
```

{% endcut %}

{% cut "到回传 URL" %}

在追踪器设置中编辑 postback URL，以添加传输宏

例如，假设跟踪 URL 包含以下参数：

```
https://redirect.appmetrica.yandex.com/serve/123456?custom_parameter=value1&another_param=value2
```

要在 postback URL 中传递 `value1` 和 `value2`，请按以下方式编辑它：

```
https://endpoint.myadnetwork.com?some_parameter={custom_parameter}&another_param={another_param}
```

{% endcut %}

{% cut "转到深链" %}

跟踪 URL 中的参数会以以下方式传递到深链：

![到深链](../../_images/tracking-url-scheme-zh.png)

在追踪器设置中编辑深链以添加传输宏

例如，假设跟踪 URL 包含以下参数：

```
https://redirect.appmetrica.yandex.com/serve/123456?custom_parameter=value1&another_param=value2
```

要在深链中传递 `value1` 和 `value2`，请按以下方式编辑它：

```
myscheme://custom_parameter={custom_parameter}&another_param={another_param}
```

{% endcut %}

## 了解更多 {#learn-more}

- [Analytics module 博客：跟踪 URL 的参数](https://appmetrica.yandex.ru/blog/custom-url-parameters)
- [Analytics module 是否使用UTM标签？](https://boost.yandex.com/doc/zh/analytics/content/troubleshooting/troubleshooting.md#utm)

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

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

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