---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ads.yandex.com/helpcenter/en/dev/flutter/target.md
  - https://ads.yandex.com/helpcenter/ru/dev/flutter/target.md
  - https://ads.yandex.com/helpcenter/zh/dev/flutter/target.md
  - href: zh/dev/flutter/target.md
    type: text/markdown
    title: Markdown version
  - href: llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://ads.yandex.com/helpcenter/zh/llms.txt

# 广告定位

您可以使用 Yandex Mobile Ads SDK API 添加额外的用户信息。向请求中添加上下文数据可显著提升广告质量进而增加收入。

## 设置定位 {#setup}

您可以在广告请求中传递用户信息：

- 针对横幅（[内联](https://ads.yandex.com/helpcenter/zh/dev/flutter/adaptive-inline-banner.md) 和 [粘性](https://ads.yandex.com/helpcenter/zh/dev/flutter/adaptive-sticky-banner.md)），请使用 `AdRequest` 类。
- 对于 [插屏广告](https://ads.yandex.com/helpcenter/zh/dev/flutter/interstitial.md)，[激励广告](https://ads.yandex.com/helpcenter/zh/dev/flutter/rewarded.md) 或 [开屏广告](https://ads.yandex.com/helpcenter/zh/dev/flutter/app-open-ad.md)，请使用 `AdRequestConfiguration`。

您可以提供以下用户信息：

#|
|| **参数** | **描述** ||
|| `age` | 用户年龄：数字（例如`14`、`18`等）。||
|| `gender` | 用户性别。可能的值：`male` 或 `female`。||
|| `location` | 由您的应用检测到的用户位置，通过 `AdLocation` 类传递。

要使用位置数据，您必须获得用户的同意，然后在 SDK 中设置 `YandexAds.setLocationTracking(true)`。||
|| `contextQuery` | 用户在应用中的搜索查询。

例如，如果用户搜索汽车，此参数可能如下所示：`"在莫斯科购买二手车"`。||
|| `contextTags` | 用户正在查看的页面中的关键字。可能是页面的标题、页面的部分内容、标记及其他元素。

对于包含汽车搜索的页面，此参数可能为`"购买汽车"`、`"二手车"`、`"在莫斯科"`。||
|#


## 定位示例 {#examples}

#### 自适应内联和粘性横幅

```dart
var adRequest = AdRequest(
	age: 20,
	contextQuery: 'context-query',
	contextTags: ['context-tag'],
	gender: 'female',
	location: const AdLocation(latitude: 55.734202, longitude: 37.588063, accuracy: 0.1),
);
```

##### 插屏广告、激励广告和开屏广告

```dart
var adRequestConfiguration = AdRequestConfiguration(
    adUnitId: 'your_block_id',
    age: 20,
    contextQuery: 'context-query',
    contextTags: ['context-tag'],
    gender: 'female',
    location: const AdLocation(latitude: 55.734202, longitude: 37.588063, accuracy: 0.1),
);
```
