# 跨域设置

> #### 什么是跨域
>
> 一项能够跨越多个不同域名追踪用户行为，将其计量为单一连续会话的功能。

### 该功能的优势

即使用户在域名间移动，会话也不会中断，因此可以准确追踪和分析用户的连续行为。

### 常见使用场景

该功能在以下场景中很有用，这些场景中用户在多个域名间移动：

**电商网站：** 商品详情页和支付页的域名不同的情况

**网站：** 产品介绍页和问卷表单页的域名不同的情况

**（示例）** 文章LP（`kijiLP.com`） → 主LP（`honLP.com`） → 支付页（`pay.com`）

## 先决条件（重要）

在所有页面上安装相同的Ptengine基本标签

完成要测量的页面的域名注册

启用跨域设置

### 配置方法

自动配置最为推荐，其他还有完全手动配置、半手动配置、API集成等方法。有关详情，请参考此文章。

自动配置按以下①→②→③的步骤进行。

打开"跨域设置"菜单后，将开关滑至ON。当显示"自动跨域配置已完成"时，配置即完成。根据需要选择参数识别符（默认为 # ）。

### **什么是参数识别符**

启用跨域设置后，Ptengine跨域参数"#\_pt\_link=\*\*\*\*"将添加到转移后的URL末尾。识别此参数的符号称为参数识别符，默认设置为"#"。如果测量网站对识别符有限制，请更改为"？或&"。

**选择"#"的情况下：**

[www.domain.com/path/#\_pt\_link=\*\*\*\*](https://gitlab.com/PtmindDev/ptx/ptengine-helps/-/blob/main/DOCS/zh/insight/setting/kurosudomein.md)

**选择"？或&"的情况下：**

(1) [www.domain.com/path/?\_pt\_link=\*\*\*\*](https://gitlab.com/PtmindDev/ptx/ptengine-helps/-/blob/main/DOCS/zh/insight/setting/kurosudomein.md)

(2) [www.domain.com/path/?campiagn=test&\_pt\_link=\*\*\*\*](https://gitlab.com/PtmindDev/ptx/ptengine-helps/-/blob/main/DOCS/zh/insight/setting/kurosudomein.md)

如果URL中已使用"？"，则如上述(2)所示，将使用"&"连接。

### 注意事项

该设置适用于Ptengine Insight和Experience两者。

如果不启用此设置，Experience中将不适用跨域测量，请注意。


---

# 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/insight/setting/cross-domain.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.
