---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ads.yandex.com/helpcenter/en/dev/react-native/target.md
  - https://ads.yandex.com/helpcenter/ru/dev/react-native/target.md
  - https://ads.yandex.com/helpcenter/zh/dev/react-native/target.md
  - href: zh/dev/react-native/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 添加额外的用户信息。向请求中添加上下文数据可显著提升广告质量进而增加收入。

## 设置定位

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

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

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

#|
|| **参数** | **描述** ||
|| `age` | 用户年龄：字符串格式的数字（例如`"14"`、`"18"`等）。 ||
|| `contextQuery` | 用户在应用中的搜索查询。

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

对于包含汽车搜索的页面，此参数可能包含诸如`"购买汽车"`、`"二手车"`、`"在莫斯科"`等短语。||
|| `gender` | 用户性别：指定为 Gender 枚举中的一个值。可接受的值：`Gender.Male`、`Gender.Female`。||
|| `location` | 用户位置：由 Location 类的实例表示，其中包含纬度和经度值。例如：`new Location(55.734202, 37.588063)`。||
|#

## 定位示例 {#examples}

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

```ts
let adRequest = new AdRequest({
    age: '20',
    contextQuery: 'context-query',
    contextTags: ['context-tag'],
    gender: Gender.Male,
    location: new Location(55.734202, 37.588063)
});
```

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

```ts
let adRequestConfiguration = new AdRequestConfiguration({
    adUnitId: 'your_block_id',
    age: '20',
    contextQuery: 'context-query',
    contextTags: ['context-tag'],
    gender: Gender.Female,
    location: new Location(55.734202, 37.588063)
});
```
