# ユーザー識別タグの設定方法

## **ユーザー識別タグの設定**

⚠️**注意事項**

* サンプルタグはあくまで参考用です。実際の実装時には、サイトの構造やデータ取得方法に合わせてカスタマイズが必要です。
* 識別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. Ptengine Experienceにログイン
2. 「データ管理」>「タグ取得」へ移動
3. 「タグ取得」>「ユーザー識別」を選択
4. ユーザー識別用タグをコピー
5. 計測したいページを選定
   1. ユーザー情報取得ページ（メールアドレス、性別、IDなど）
   2. 具体的なアクション発生ページ（登録、ログイン、購買など）
6. GTM経由もしくは5で選定したページに直貼り

### 💡 タグのカスタマイズ

* ユーザー識別ID：変更の少ないユニークな情報（例：アカウントID）
* ユーザーラベル：データの項目名（例：名前、性別、年齢）
* 値：ユーザーが入力した実際の内容

### 🚀 実装のポイント

* ログインや登録が完了した瞬間にタグを発火させる
* フォーム送信時にユーザー識別IDと値を動的に取得する

***

## **ユーザー識別タグの設定実例**

🌟 シナリオ：「登録」ボタンクリック時にユーザー情報を取得

![](/files/Q89aoo0uqpkkcFYq9gWL)

### 📋 取得情報：

* ユーザー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/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.
