> For the complete documentation index, see [llms.txt](https://helps.ptengine.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://helps.ptengine.com/experience/setting/user-identification/user-id-tag-setup.md).

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

## **ユーザー識別タグの設定** <a href="#user-identification-tag-settings" id="user-identification-tag-settings"></a>

⚠️**注意事項**

* サンプルタグはあくまで参考用です。実際の実装時には、サイトの構造やデータ取得方法に合わせてカスタマイズが必要です。
* 識別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'))
        }
```

### 📌 推奨設定場所 <a href="#recommended-setup-locations" id="recommended-setup-locations"></a>

ユーザー情報を取得し、身分を特定できる箇所に設定します。例えば：

* ログインページ
* 会員登録ページ
* ユーザー情報更新ページ

### 🔧 設定手順 <a href="#setup-steps" id="setup-steps"></a>

1. Ptengine Experienceにログイン
2. 「データ管理」>「タグ取得」へ移動
3. 「タグ取得」>「ユーザー識別」を選択
4. ユーザー識別用タグをコピー
5. 計測したいページを選定
   1. ユーザー情報取得ページ（メールアドレス、性別、IDなど）
   2. 具体的なアクション発生ページ（登録、ログイン、購買など）
6. GTM経由もしくは5で選定したページに直貼り

### 💡 タグのカスタマイズ <a href="#tag-customization" id="tag-customization"></a>

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

### 🚀 実装のポイント <a href="#implementation-points" id="implementation-points"></a>

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

***

## **ユーザー識別タグの設定実例** <a href="#user-identification-tag-setup-example" id="user-identification-tag-setup-example"></a>

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

![](https://4061457514-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgRz7WrQwZOO6dfD8wRWy%2Fuploads%2Fgit-blob-89b09bfc697e7ff72a024fb04a2f16c84058895b%2Fexperience-setting-user-id-tag-setup-01.png?alt=media)

### 📋 取得情報： <a href="#information-to-be-collected" id="information-to-be-collected"></a>

* ユーザーID (uid)
* メールアドレス
* 電話番号
* 性別
* 年齢
* 登録日

### 🔧 タグ実装例 <a href="#tag-implementation-example" id="tag-implementation-example"></a>

```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()
    })
});
```

### 📊 活用例 <a href="#usage-examples" id="usage-examples"></a>

このタグ設定により、ユーザーの登録プロセスを詳細に分析し、以下のような施策が可能になります：

* 年齢層別のコンバージョン率分析
* 性別に応じたパーソナライズドコンテンツの提供
* 登録日ベースのリテンションマーケティング

この実装例を基に、各サイトの具体的な要件やセキュリティ方針に合わせてカスタマイズしてください。
