Articles in this section
Category / Section

Install Website Tracking with Shopify App

Watch a video walkthrough:



Step 1: Create Tracklution Account

First, get started at www.tracklution.com by creating an account and providing your store URL. Tracklution will check if your site operates with Shopify, and if it does, it will suggest you install the Shopify App.

Step 2: Install Tracklution to Your eCommerce Store with Shopify App

  1. Sign in to your Shopify store and navigate to Settings → Customer Events → Add Custom Pixel.
  2. Create a new pixel and give it a name such as "Tracklution App".
  3. Configure the following settings for Customer Privacy:
    • Permission: Not required (Tracklution reads consents automatically). If you want the pixel not be loaded at all before consent is granted, you can select "Required". In that case Tracklution will be installed with Basic consent mode. Read more from here: Compatibility with Cookie Banners and Consent Mode (v2)
    • Data Sale: Data collected does not qualify as a data sale.
  4. In your Tracklution onboarding guide, you will see a script window with a copy button. Copy the script and add it to the newly created Customer Event code field.
    Script Copy Example
  5. Click Save (top right corner) and Connect (bottom right).
Tracklution will automatically configure the following eCommerce events: PageView, ViewContent, AddToCart, InitiateCheckout, AddPaymentInfo, and Purchase. Tracklution will also automatically set up underlying eCommerce variables (such as product IDs and variations) and Enhanced Conversions.

Step 3: Add Webhook

  1. Go to Shopify Settings → Notifications → Webhooks → Create Webhook.
  2. Configure the webhook settings as follows:
    • Event: Order creation
    • Format: JSON
    • Webhook API version: Use the version labeled “latest”
    • URL: Copy and paste the URL from Tracklution into the URL box.

Voilá! You’re done with the installation!

You will now start seeing session data populating in real time in your Tracking Container within the “Processed Data” table. This allows you to easily verify that your setup is successful and that all desired events are being correctly recorded.

Step 4: Set DNS for First Party Data Collection

Setting up the DNS CNAME allows Tracklution to load scripts under your own domain, enabling the use of First Party Cookies. This improves data accuracy, ensures more reliable tracking, and helps you get the most out of your tracking setup. See instructions from here:  First-Party Mode (DNS)

Installing Other (Custom) Events

You can use Google Tag Manager simultaneously. If you want to configure other events, you need to install the Tracklution Main script without PageViews (found from the "Google Tag Manager (custom HTML)" installation instructions inside your container, in Step 1). To remove the PageView tracking from the main script, delete the highlighted row from the Main Tag script that you find from your installation instructions:

Screenshot 2025-08-20 at 13.33.44

After this, you can use the custom HTML tags or Template tags in GTM to install the desired events (Note! PageViews are already installed with the Shopify App):

Shopify Markets with Multiple Domains

If your Shopify store uses Shopify Markets with multiple domains (for example, .fi, .de, and .com), and each market has its own ad account, the tracking should be kept separate. Create a separate Tracklution container for each market, perform a separate Shopify installation for each container, and connect each container to its respective ad account. This ensures that events from each domain are correctly routed to the right Tracklution Domain ID and ad account.

If you want to track multiple stores in one container, read our article about cross-domain tracking from here: Cross-Domain Tracking

Editing the Shopify Installation Script

The standard Shopify customer events code can be edited and customised to match your use case by simply editing the code that you see in Step 1 of the installation instructions.

Removing PII or Sensitive Data from Being Collected

In some cases, such as when advertising health-related or other regulated products, you may want to prevent Tracklution from collecting or sending personally identifiable information (PII) or product details that could be considered sensitive by ad platforms like Meta. You can customize your installation to remove any fields you don’t want to collect by removing the collection of PII by editing your Customer Events script:

  1. If you already have Tracklution installed, go to Shopify admin, go to Settings → Customer events and find the script from there. If you don't have it already installed you find it from the Step 1 in Shopify installation instructions.
  2. Locate the ContactInfo section near the end of the script and delete it. This section includes fields such as email, phone number, name, and address.
  3. Go to Settings → Notifications → Webhooks and delete the Tracklution webhook, as it would otherwise continue sending contact data.
  4. If needed, you can also remove product-related fields (like item_name or url) from the event payloads - for example, if product titles or URLs contain sensitive medical or personal information.

Below is an example of the default Purchase event tracking tag, followed by an edited version that removes all PII and product details.

Default script - (example only! the script contains an example value LS-12345678-9 that needs to be your unique Tracklution ID):

tlq('track', 'Purchase', {
  target: 'LS-12345678-9',
  url: event.context?.document?.location?.href,
  currency: event.data?.checkout?.currencyCode,
  value: event.data?.checkout?.totalPrice?.amount,
  tax: event.data?.checkout?.totalTax?.amount,
  shipping: event.data?.checkout?.shippingLine?.price?.amount,
  items: lineItems,
});

const billingAddress = event.data?.checkout?.billingAddress;

tlq('set', 'ContactInfo', {
  target: 'LS-12345678-9',
  url: event.context?.document?.location?.href,
  email: event.data?.checkout?.email,
  phoneNumber: event.data?.checkout?.phone || billingAddress?.phone,
  firstName: billingAddress?.firstName,
  lastName: billingAddress?.lastName,
  address: billingAddress?.address1,
  postCode: billingAddress?.zip,
  city: billingAddress?.city,
  country: billingAddress?.country,
  isFirstOrder: event.data?.checkout?.order?.customer?.isFirstOrder,
});
Edited PII-safe version (example only! the script contains an example value LS-12345678-9 that needs to be your unique Tracklution ID):
tlq('track', 'Purchase', {
  target: 'LS-12345678-9',
  url: event.context?.document?.location?.href,
  currency: event.data?.checkout?.currencyCode,
  value: event.data?.checkout?.totalPrice?.amount,
});

Tracking Product ID together with Variant ID

By default, Tracklution’s Shopify installation sends the variant ID as the product identifier, since it provides the most specific reference to the purchased product. If the variant ID is not available, Tracklution automatically falls back to the product ID. If you prefer to include both the product ID and variant ID (for example, to match your product feed structure), you can customise this through the Customer Events installation by editing the event structure.

Edit the script from this:

{
    item_id: productVariant?.sku,
    item_name: productVariant?.product?.title,
    item_variant: productVariant?.title,
    item_brand: productVariant?.product?.vendor,
    sku:  productVariant?.sku,
    variant_id: productVariant?.id,
    product_id:  productVariant?.product?.id,
    price: productVariant?.price?.amount,
    currency: productVariant?.price?.currencyCode,
}

To this:

{
    item_id: productVariant?.sku,
    item_name: productVariant?.product?.title,
    item_variant: productVariant?.title,
    item_brand: productVariant?.product?.vendor,
    sku:  productVariant?.sku,
    variant_id: productVariant?.product?.id,
    product_id:  productVariant?.product?.id,
    price: productVariant?.price?.amount,
    currency: productVariant?.price?.currencyCode,
}


Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied