# Shopify Integration

Tracknow integrates with Shopify stores to automatically transmit data for completed purchases into your Tracknow dashboard. This enables accurate tracking and attribution of purchases made by customers referred by your affiliates.

***

### Methods of Integration

There are two supported methods for integrating Tracknow with a Shopify store:

{% columns %}
{% column %}
**Tracknow Plugin**

Tracknow provides a Shopify app that can be installed on a Shopify store to enable purchase tracking
{% endcolumn %}

{% column %}
**Webhooks**

Implement the required scripts and configure Shopify webhooks to enable purchase tracking
{% endcolumn %}
{% endcolumns %}

<table><thead><tr><th width="369">Plugin</th><th>Webhooks</th></tr></thead><tbody><tr><td>Simple installation process</td><td>More manual and technical implementation</td></tr><tr><td>Higher chance of missing some purchases due to Shopify privacy limitations</td><td>Lower chance of missing some purchases due to Shopify privacy limitations</td></tr><tr><td>More control over what purchases will be tracked</td><td>All purchases are tracked (filtration is handled on Tracknow side)</td></tr><tr><td>Only relevant purchase details are sent to Tracknow</td><td>The entire order payload is sent to Tracknow</td></tr></tbody></table>

***

### Prerequisites

Both integration methods require you to enable passing our unique affiliate identifier `click_id` to your landing page.\
\
For instructions, click [here](https://docs.tracknow.io/integrations/passing-click_id-to-a-landing-page).

***

### Plugin Integration

Login to the Shopify admin dashboard → **Settings** → **Apps** → **Shopify App Store** → Search for the [**Tracknow Integration**](https://apps.shopify.com/tracknow-affiliate-software) app → Install the app

<figure><img src="https://1097958070-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHX682uo79XLNkfkN58br%2Fuploads%2FgyL9yFEqlyU5kCUrVrfp%2Fimage.png?alt=media&#x26;token=cde70553-d93a-4e0b-aa3e-96ab67ef7781" alt=""><figcaption></figcaption></figure>

Navigate back to the Shopify dashboard → Open the **Tracknow Integration** app → **Setup Configuration**

<figure><img src="https://1097958070-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHX682uo79XLNkfkN58br%2Fuploads%2FIkcyqtG2wB6Ivpc8zBVj%2Fimage.png?alt=media&#x26;token=7bf7c9af-508d-4e15-9b7a-90cf70a1a09f" alt=""><figcaption></figcaption></figure>

Fill out the configuration form → **Update**

<figure><img src="https://help.tracknow.io/wp-content/uploads/2026/01/image-19.png" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="216">Field</th><th>Description</th></tr></thead><tbody><tr><td><strong>Tracknow Namespace Name</strong></td><td>Enter the Tracknow namespace to which data should be sent. This value is available in the Tracknow dashboard main menu.</td></tr><tr><td><strong>Tracknow Campaign ID</strong></td><td>Enter the Tracknow Camapign ID to which data should be sent</td></tr><tr><td><strong>Enable Coupon Filter</strong></td><td>Enter a value to limit tracking to orders that used a coupon code containing the specified string. Orders without a coupon code will still be tracked if the customer has a Tracknow referral identifier cookie.</td></tr></tbody></table>

Navigate to **Settings** → **Customer Events** → Confirm that the plugin status is **Connected**

<figure><img src="https://1097958070-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHX682uo79XLNkfkN58br%2Fuploads%2FVB24rP1Gm0chSwQ2KMkB%2Fimage.png?alt=media&#x26;token=74fc0db6-f30d-497f-aeae-1935687933a6" alt=""><figcaption></figcaption></figure>

***

### Webhook Integration

Login to the Shopify admin dashboard → **Online Store** → **Themes** → Three-dot icon next to your **Current Theme** → **Edit Code**

<figure><img src="https://1097958070-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHX682uo79XLNkfkN58br%2Fuploads%2F14BfRl8euAxLP9CIKT17%2Fimage.png?alt=media&#x26;token=bfa54c89-1442-467e-97c1-422ee55eb007" alt=""><figcaption></figcaption></figure>

Expand the **layout** tab in the file explorer → Select the **theme.liquid** file

<figure><img src="https://1097958070-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHX682uo79XLNkfkN58br%2Fuploads%2FjWBian6QiEWwPHske5G3%2Fimage.png?alt=media&#x26;token=affd5e2c-9f04-4ed0-aa07-864baf389b51" alt=""><figcaption></figcaption></figure>

Locate the \</head> section closing tag → Insert the following script into the \<head> section of the page, immediately before the closing \</head> tag → **Save**

<pre class="language-javascript"><code class="lang-javascript">&#x3C;script>
  window.tracknow =
    window.tracknow ||
    function () {
      (window.tracknow.q = window.tracknow.q || []).push(arguments);
    };

  tracknow("config", {
    namespace: "<a data-footnote-ref href="#user-content-fn-1">{REPLACE WITH TRACKNOW NAMESAPCE}</a>",
    shopify: true,
  });
&#x3C;/script>

&#x3C;script async src="https://static.tracknow.io/js/tracking.min.js">&#x3C;/script>
</code></pre>

{% hint style="info" %}
Replace the **{REPLACE WITH TRACKNOW NAMESAPCE}** placeholder with your actual Tracknow namespace before pasting this script into the **theme.liquid** file
{% endhint %}

<figure><img src="https://1097958070-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHX682uo79XLNkfkN58br%2Fuploads%2FEuK7YFhgvr5UBNteawoY%2Fimage.png?alt=media&#x26;token=8bdfdc10-2ef1-451c-96e8-8328b40e4bb7" alt=""><figcaption></figcaption></figure>

This script loads the Tracknow JavaScript library that handles storing the Tracknow referral identifier (click\_id) in the customer’s browser.

Navigate to **Settings** → **Notifications** → **Webhooks** → **Create Webhook**

<figure><img src="https://1097958070-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHX682uo79XLNkfkN58br%2Fuploads%2FG725KKgUsSNyxfrjx3T6%2Fimage.png?alt=media&#x26;token=f7ad64dd-c7a5-4e9d-9533-a163ac28826a" alt=""><figcaption></figcaption></figure>

Configure the webhook using the following settings → **Save**

<figure><img src="https://1097958070-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHX682uo79XLNkfkN58br%2Fuploads%2FuWMGsBKXvcauFyQuSw8v%2Fimage.png?alt=media&#x26;token=9f14db69-3f1f-4988-b985-f0f23c3682a8" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="218">Field</th><th>Value</th></tr></thead><tbody><tr><td>Event</td><td>Order Payment</td></tr><tr><td>Format</td><td>JSON</td></tr><tr><td>URL</td><td>https:/<strong>{namespace}</strong>-tracking.tracknow.info/wh/shopify/<strong>{campaignId}</strong>?orderIdField=order_number</td></tr><tr><td>Webhook API version</td><td>2026-01</td></tr></tbody></table>

{% hint style="info" %}
Replace the **{namespace}** placeholder with your actual Tracknow namespace before pasting this URL\
Replace the **{campaignId}** placeholder with your actual Tracknow campaign ID before pasting this URL
{% endhint %}

***

### Important Notes

* Ensure that the Shopify store does not use both integration methods simultaneously, as this may result in tracking issues and duplicate order events
* When switching between integration methods, fully disable the existing integration before enabling the new one

[^1]:
