# 用户识别标签的设置方法

## 用户识别标签的设置方法

## **用户识别标签的设置**

⚠️**注意事项**

示例标签仅供参考。在实际实施时，需要根据网站的结构和数据获取方法进行自定义。

如果无法获取识别ID，将作为匿名用户进行计测

考虑用户隐私，仅获取最必要的信息

```jsx
//用户识别标签
ptengine.identify('用户识别ID', {　
    用户标签1: '值',
    用户标签2: '值'
});

//实际设置示例
    if(userId){
        ptengine.identify(userId, { 
            free_registered_date: {{registered_date}},
            monthly_registered_date: {{pay_date}},
            member_status: {{member_status}},
            user_id: pickPatternIdFromAcVisitorUserId(getCookieValue('user_id'))
        }
```

### 📌 推荐设置位置

在可以获取用户信息并确定身份的位置进行设置。例如：

登录页面

会员注册页面

用户信息更新页面

### 🔧 设置步骤

1. 进入"数据管理">"标签获取"
2. 选择"标签获取">"用户识别"
3. 复制用户识别标签
4. 选定要监测的页面 用户信息获取页面（电子邮件、性别、ID等）
5. 具体操作发生页面（注册、登录、购买等）
6. 直接粘贴到第5步选定的页面

### 💡 标签的自定义

用户识别ID：变动较少的唯一信息（例：账户ID）

用户标签：数据项目名称（例：姓名、性别、年龄）

值：用户输入的实际内容

### 🚀 实施要点

在登录或注册完成的时刻激发标签

### 在表单提交时动态获取用户识别ID和值

## **用户识别标签的设置实例**

🌟 场景：单击"注册"按钮时获取用户信息

### 📋 获取信息：

用户ID (uid)

电子邮件地址

电话号码

性别

年龄

注册日期

### 🔧 标签实现示例

```jsx
document.getElementById('btnSignup').addEventListener('click', function() {
    ptengine.identify(document.getElementById('uid').value, {
        email : document.getElementById('email').value,
        phone : document.getElementById('phone').value,
        gender: document.getElementById('sex').value,
        age: document.getElementById('age').value,
        last_active_date: new Date()
    })
});
```

### 📊 使用示例

通过此标签设置，可以详细分析用户的注册流程，并能够实施以下措施：

按年龄段进行转化率分析

根据性别提供个性化内容

基于注册日期的留存营销

基于此实现示例，请根据各网站的具体要求和安全政策进行自定义。


---

# 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://helps.ptengine.com/cn/experience/setting/user-identification/user-id-tag-setup.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.
