# クロスドメイン設定

{% hint style="success" %}
**クロスドメインとは**

複数の異なるドメインにまたがるユーザーの行動を、一つの連続したセッションとして計測するための機能です。
{% endhint %}

### この機能のメリット

ドメインを移動してもセッションが途切れないため、ユーザーの一連の行動を正確に追跡・分析できます。

### よくある利用シーン

この機能は、ユーザーが複数のドメイン間を移動する以下のような場面で役立ちます。

* **ECサイト:** 商品詳細ページと決済ページのドメインが異なる場合
* **Webサイト:** 製品紹介ページと問い合わせフォームページのドメインが異なる場合

**（例）**\
記事LP（`kijiLP.com`） → 本LP（`honLP.com`） → 支払いページ（`pay.com`）

## 前提条件（重要）

1. 全ページに同じPtengine基本タグを設置
2. 計測したいページのドメイン登録完了
3. クロスドメイン設定をON

### 設定方法

自動設定が最も推奨されており、その他には全手動設定、半手動設定、API連携の方法があります。詳しくは、こちらの記事をご参照ください。

自動設定は下記①→②→③の手順で進めてください。

<figure><img src="/files/bsgYXsl5o1OcpHnQzhEN" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/wCNHTJKPMMXM0CBip490" alt=""><figcaption></figcaption></figure>

「クロスドメイン設定」のメニューを開いたら、スイッチをONにスライドします。「自動クロスドメインの設定が完了しました」と表示されたら設定完了です。必要に応じて、パラメータ識別子を選択ください（デフォルトでは # となります）。

![](/files/cVyD9gspsd52ztZ8vd8b)

![](/files/hferQv4cblLdTbwWWb69)

### **パラメータ識別子とは**

クロスドメイン設定を有効化すると、遷移後URLの末尾に Ptengine クロスドメインのパラメーター「#\_pt\_link=\*\*\*\*」が必ず付与されます。このパラメータを識別する記号をパラメータ識別子と言い、デフォルトで「#」として設定されています。計測サイト側で識別子を制限している場合に「 ? または & 」に変更ください。

**「#」を選択した場合：**

[www.domain.com/path/#\_pt\_link=\*\*\*\*](http://www.domain.com/path/#_pt_link=****)

**「 ? または & 」を選択した場合：**

(1) [www.domain.com/path/?\_pt\_link=\*\*\*\*](http://www.domain.com/path/?_pt_link=****)

(2) [www.domain.com/path/?campiagn=test&\_pt\_link=\*\*\*\*](http://www.domain.com/path/?campiagn=test&_pt_link=****)

既に ? が使用されているURLの場合に、上記 (2) のように & で繋がれます。

### 注意事項

* この設定は、Ptengine InsightとExperienceの両方に適用されます。
* 設定をONにしない場合、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/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.
