# Shopify Cart Permalinks

> Set up tracking-friendly permalinks to your Shopify cart or checkout from external websites. Maintain accurate attribution and conversion tracking when linking from WordPress, landing pages, or other sites to your store.

<Prerequisites
  title="Before you begin"
  items={[
    { label: "You have an AnyTrack account with a Property set up", done: true },
    { label: "You have configured the Shopify integration as a Conversion Source in AnyTrack", done: true },
    { label: "The AnyTrack Tracking Tag is installed on your website", done: true },
  ]}
/>

## What Are Tracking-Friendly Permalinks?

**Permalinks** are direct links that take visitors straight to a specific page or action on your website. In this case, we're talking about links that send people directly to a preloaded Shopify cart or checkout page.

**Tracking-friendly permalinks** are these same links, but modified to maintain proper visitor tracking when people click from external websites (like WordPress blogs, Funnelish pre-landers, or any landing page) to your Shopify store.

> 📘 **Why permalinks are required for Shopify (not "instead of" cross-domain)**
>
> Shopify's checkout cannot run third-party scripts, so the AnyTrack Tag is never present on the checkout page. The click ID can't be captured client-side at checkout — it has to be carried in as a Shopify cart attribute. That's what `?attributes[__atclid]=--CLICK-ID--` does. The standard cross-domain auto-tag parameters (`atclid`, `atrefid`) are not read by Shopify and will not reach the order.
>
> This applies to **every** external page that links into a Shopify cart or checkout, regardless of whether the source page and your Shopify store share a root domain. If the source page is on a different root domain from your Shopify store, you'll also need cross-domain tracking so the AnyTrack Tag on the source page has a click ID to substitute. The permalink itself is what lands the click ID into the Shopify order either way.

## Why Use Tracking-Friendly Permalinks?

### The Problem You're Solving

When visitors click a regular permalink from an external website to your Shopify cart, they bypass your store's normal visitor flow. This creates several issues:

* **Lost tracking data**: Visitors are not recognized as tracked users
* **Attribution errors**: Conversion events are not properly attributed to your marketing efforts
* **Incomplete analytics**: Events show as errors in your [Event Log](/docs/integration-event-log)
* **Wasted ad spend**: You cannot optimize campaigns without accurate conversion data

### The Business Benefits

Using tracking-friendly permalinks ensures you:

* Maintain accurate visitor tracking across all touchpoints
* Get complete conversion attribution for better ROI analysis
* Reduce tracking errors in your analytics
* Make data-driven decisions about your marketing campaigns

## How to Create Tracking-Friendly Permalinks

### Example Scenario

Let's say you have a WordPress button that links directly to a preloaded Shopify cart: `https://myshopify.com/cart/44568549196023:1`

Without proper tracking setup, visitors who click this link are not recognized by your analytics.

Here's a live example: <Anchor label="Permalink to your product" target="_blank" href="https://shop.tracking.school/cart/40686242627693:1">Permalink to your product</Anchor>

### Step-by-Step Solution

Follow these three steps to fix your permalink tracking:

#### Step 1: Modify Your Permalink URLs

Add this tracking parameter to the end of your existing permalinks: `&attributes[__atclid]=--CLICK-ID--`

**Before:**

```
https://myshopify.com/cart/44568549196023:1
```

**After:**

```
https://myshopify.com/cart/44568549196023:1?attributes[__atclid]=--CLICK-ID--
```

**What this does:** The `--CLICK-ID--` parameter passes the unique tracking identifier from your external website to Shopify. This ensures visitors are recognized as the same person throughout their journey.

#### Step 2: Install the AnyTrack Tag

Make sure your external website (the one hosting these links) has the **[AnyTrack Tracking Tag installed](/docs/install-anytrack-tag)**.

**What this does:** The AnyTrack Tracking Tag is a small piece of code that enables proper attribution and event tracking across different platforms. It automatically handles the [AutoTag](/docs/autotag) feature that replaces `--CLICK-ID--` with the actual tracking identifier.

#### Step 3: Follow Shopify's Best Practices

Use Shopify's recommended permalink structure instead of generic "Buy Now" buttons.

**Why this matters:** Shopify specifically advises against using their standard "Buy Now" button for external links.

**Reference:** Check [Shopify's official permalink documentation](https://community.shopify.com/c/Shopify-design/cart-use-permalinks-to-pre-load-the-cart/td-p/613702#adding-a-buy-this-link-to-a-blog-post) for detailed guidelines.

## Testing Your Implementation

After setting up your tracking-friendly permalinks:

1. **Check the [Event Log](/docs/integration-event-log)** - Monitor real-time browser-side events to ensure proper tracking
2. **Review the [Conversion Log](/docs/integration-event-log)** - Verify server-side conversion data from Shopify
3. **Test cross-platform attribution** - Confirm that purchases are correctly attributed to the original traffic source

## Results

Once you implement these changes:

* Visitors will be properly tracked from external websites to your Shopify store
* All conversion events will be correctly attributed to your marketing campaigns using AnyTrack's [server-side tracking](/docs/server-side-tracking)
* Your Events Log will show fewer errors
* You will have complete data for optimizing your sales funnel

**Technical note:** The AnyTrack Tag handles the technical details of passing tracking information between platforms, so you don't need to worry about the underlying mechanics.

<FaqAccordion
  title="Shopify Cart Permalinks - Frequently Asked Questions"
  icon="fa-duotone fa-circle-question"
  items={[
    {
      question: "What is the difference between a regular permalink and a tracking-friendly permalink?",
      answer: "A regular Shopify cart permalink sends visitors directly to a preloaded cart. A tracking-friendly permalink adds the <code>attributes[__atclid]=--CLICK-ID--</code> parameter, which passes the visitor's AnyTrack click ID to Shopify. This connects the purchase back to the original traffic source."
    },
    {
      question: "Does the AnyTrack tag need to be on the external website or on Shopify?",
      answer: "The AnyTrack Tracking Tag must be installed on the external website — the page where the permalink is placed. AnyTrack reads the visitor's click ID from that page and injects it into the link. Your Shopify store does not need a separate tag installation for this to work."
    },
    {
      question: "What happens if I do not add the tracking parameter to my permalinks?",
      answer: "Without the tracking parameter, visitors who click the permalink are not recognized as tracked users when they land on Shopify. Their purchase will still be processed, but the conversion will not be attributed to the correct traffic source and will appear as an error in your Event Log."
    }
  ]}
/>
