> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.wikiguide.link/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Shortlyでサードパーティ決済トラッキングを有効にする

# 💳 Shortlyでサードパーティ決済トラッキングを有効にする

Shortlyの「チェックアウト設定」タブでは、カスタムチェックアウトを使用しているマーチャントが、Shopifyの標準チェックアウトフロー以外でもアフィリエイトアトリビューションを追跡できるようになります。

![](https://storage.crisp.chat/users/helpdesk/website/-/a/9/5/5/a9552c769f21a000/1_1aaxtmq.png)

### 🧠 なぜサードパーティ決済トラッキングを有効にするのか？
この機能は以下のような場合に役立ちます：
* カスタムチェックアウトエクスペリエンスを使用している場合
* ヘッドレスコマース構成の場合
* サードパーティ製チェックアウトツールを使用している場合

JavaScriptベースのピクセルトラッキングを利用することで、アフィリエイトの売上が正確にトラッキングされ続けます。

### ✅ 有効にする方法
ステップバイステップ：
1. Shopify管理画面にアクセスします。
2. 「設定」＞「カスタマーイベント」に移動します。

![](https://storage.crisp.chat/users/helpdesk/website/-/a/9/5/5/a9552c769f21a000/2_18cmlnu.png)

3. 「カスタムピクセルを追加」をクリックします。

![](https://storage.crisp.chat/users/helpdesk/website/-/a/9/5/5/a9552c769f21a000/3_1ig3hhi.png)

4. ピクセルの名前を入力し、「ピクセルを追加」をクリックします。

![](https://storage.crisp.chat/users/helpdesk/website/-/a/9/5/5/a9552c769f21a000/4_rj77e2.png)

5. Shortlyのチェックアウトトラッキングスクリプトをピクセルコード欄に貼り付けます。

6. 「接続」をクリックして有効にします。

![](https://storage.crisp.chat/users/helpdesk/website/-/a/9/5/5/a9552c769f21a000/5_10iuu19.png)

### 📜 チェックアウトトラッキングスクリプト
以下が貼り付ける必要があるスクリプトです：

`analytics.subscribe("checkout_started", async (event) => {`
`var script = document.createElement("script");`
`script.src = "https://shortly.link/assets/js/shortly.js";`
`document.querySelector("body").appendChild(script);`
`});`
