# Advocate 自定义字段详解

您可以使用 *自定义字段* 向 impact.com 发送有关您推荐计划中参与者的额外数据。这些信息可用于您的 [计划规则](https://help.impact.com/brand/zh/nin-xiang-liao-jie-shen-me/advocate-program/getting-started-with-advocate/advocate-program-rules-explained) 以确定何时触发目标和操作。您还可以根据自定义字段值对参与者进行分段。

您发送的自定义字段类型很灵活。例如，您可能希望包含有关参与者的以下信息：

* 生日
* 语言
* 位置
* 订阅类型
* 会员状态

自定义字段可以在您上传用户导入文件时或通过 UTT、API、SDK 或其他集成方法发送到 impact.com。

#### 字段特性

您发送的任何自定义字段都需要满足字段名称和值的一些要求。

{% tabs %}
{% tab title="名称" %}

* 最多 64 个字符。
* 仅接受字母数字字符、连字符和下划线（字母必须为无重音字符）。
* 区分大小写，例如， `customFieldName` 被视为与 `customfieldname`.
  {% endtab %}

{% tab title="数值" %}

* 支持 `字符串`, `数量`, `布尔值`，和 `空值 类型`.
* 字符串最大值为 1024 个字符。
* 日期必须格式化为以毫秒为单位的 UNIX 时间戳。
* 每个请求最多可添加/更新 100 个字段。
* 将用户的自定义字段设置为 `null` 将删除该用户的该字段。
  {% endtab %}
  {% endtabs %}

#### 向 impact.com 发送自定义字段信息

无论使用哪种发送数据的方法，只要您创建、更新或 upsert 用户时，都可以包含自定义字段。

{% tabs %}
{% tab title="文件导入" %}
在批量导入新用户或更新现有用户时，您可以包含自定义字段。请参阅 [批量导入推荐参与者](https://help.impact.com/brand/zh/nin-xiang-liao-jie-shen-me/advocate-program/manage-advocate-participants/import-advocate-participants-in-bulk) 以获取说明。

下面是两个示例文件，您可以用来指导导入。

* 用户数据导入： [CSV](https://assets.ctfassets.net/s68ib1kj8k5n/7LOYwhDlsI22uuaIMaWImE/71cefe860edc71c0968c8065e1d6e953/sample-user-upload.csv) ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-06e12321258e7eb7ac63ef7e73640b29fcf2baad%2Fcff634f1183ca82d3b56ab55dd636140372687d8dbc6520872cdbe5010347326.svg?alt=media) 或 [JSONL](https://assets.ctfassets.net/s68ib1kj8k5n/5rD1ZiKEjqStp54qjDB90N/48918dfa8b53a935c7c83ea5fbf3af77/userImportSample.jsonl) ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-06e12321258e7eb7ac63ef7e73640b29fcf2baad%2Fcff634f1183ca82d3b56ab55dd636140372687d8dbc6520872cdbe5010347326.svg?alt=media)
* 事件数据导入： [CSV](https://assets.ctfassets.net/s68ib1kj8k5n/20lD8Gua3EtW8qIahBvciz/152fd3cfaa3f0ee4076a6729bc8d4164/userEventSample.csv) ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-06e12321258e7eb7ac63ef7e73640b29fcf2baad%2Fcff634f1183ca82d3b56ab55dd636140372687d8dbc6520872cdbe5010347326.svg?alt=media) 或 [JSONL](https://assets.ctfassets.net/s68ib1kj8k5n/2IPDDkVhCgDBPyQrRANfb9/d38643fba660ca1412b7d85f1b7c0f41/userEventSample.jsonl) ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-06e12321258e7eb7ac63ef7e73640b29fcf2baad%2Fcff634f1183ca82d3b56ab55dd636140372687d8dbc6520872cdbe5010347326.svg?alt=media)
  {% endtab %}

{% tab title="API 和 SDK" %}
在使用 impact.com 的 [GraphQL 方法](https://integrations.impact.com/impact-brand/docs/graphql-reference) 或 [REST API 端点](https://integrations.impact.com/impact-brand/docs/saasquatch-rest-api-1) 创建、更新或 upsert 用户时，可以包含自定义字段。使用 [UTT](https://integrations.impact.com/impact-brand/docs/install-the-utt) 或我们的 [移动选项](https://integrations.impact.com/impact-brand/docs/saasquatch-mobile-overview-1) 也可以在您的应用程序内创建、更新或 upsert 用户时包含它们。
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.impact.com/brand/zh/nin-xiang-liao-jie-shen-me/advocate-program/manage-advocate-participants/custom-and-calculated-fields/custom-fields-for-advocate-explained.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
