> ## 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).

# Shopify Third-Party Checkout Tracking in Shortly: Affiliate Attribution via Custom Pixels


# 💳 **Shopify Third-Party Checkout Tracking in Shortly: Affiliate Attribution via Custom Pixels**

The **Checkout Settings** tab in Shortly allows merchants using custom checkouts to track affiliate attribution beyond the standard Shopify checkout flow.

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

## 🧠 Why Enable Third-Party Checkout Tracking?

This feature is helpful if you're using:
* A custom checkout experience
* Headless commerce setup
* Third-party checkout tools 

It ensures affiliate sales are still tracked accurately using JavaScript-based pixel tracking.
---

## ✅ How to Enable

### Step-by-step:

1. Go to your Shopify Admin.

2. Navigate to **Settings > Customer events**.

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

3. Click **Add Custom Pixel**.

![](https://storage.crisp.chat/users/helpdesk/website/-/a/9/5/5/a9552c769f21a000/image_1lmw6jb.png)
4. Enter name of the pixel and click on Add Pixel.

![](https://storage.crisp.chat/users/helpdesk/website/-/a/9/5/5/a9552c769f21a000/image_koh9pq.png)
5. Paste the Shortly checkout tracking script into the pixel code box.
6. Click **Connect** to enable.

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

## 📜 Checkout Tracking Script

Here’s the script you need to paste:
`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);`
`});`