Skip to main content
All CollectionsAccount & Datasource Set-UpAttribution
Setting up the Legacy Klar Pixel for Shopify
Setting up the Legacy Klar Pixel for Shopify

How to set up the Klar tracking pixel by validating your domain, implementing the tracking script, and adjusting UTM parameters.

Frank Birzle avatar
Written by Frank Birzle
Updated over 3 months ago

Do you want to start using the attribution report in Klar? Great choice 🎉

To power our fully integrated attribution solution, you need to configure the Klar Pixel datasource in Klar and implement a tracking script on your site. This should only take a few minutes.

What's the difference between the Customer Events and Legacy Klar Pixel?

Customer Events where introduced by Shopify to increase the security in your shops checkout, preventing the direct implementation of JavaScript that could potentially read and/or modify customer's information from the checkout. Now Shopify is providing a set of Customer Events that Klar can "subscribe" to in order to receive all relevant tracking information from your store. Check out our detailed instructions to setup Klar Pixel for Customer Events in Shopify.

The Legacy version of our script can be installed via your store's Liquid theme and the Checkout / Post Purchase survey section of your store's configuration. This article describes the setup process in detail.

1. Adding the Klar Pixel Datasource

If you have multiple Shopify instances connected to Klar, you should create a unique Pixel datasource for each of these stores.

  • Go to your Store Configurator page in Klar and click Connect Data Source

  • Select the Datasource Klar Pixel

  • Enter a name for the datasource - eg. Klar Tracking Script

  • Select Shopify as Shop System

  • Decide if you want to implement the tracking script via a domain-validated tracking script (first-party script) or basic tracking script (third-party script) and press configure.

We strongly recommend using a domain-validated tracking script as these are delivered via a subdomain and are therefore not directly blocked by browsers that prevent third-party JavaScripts by default.

  • If you selected basic tracking, you will now see the tracking script that you need to add to your site. For that, skip ahead to the next section.

  • If you selected the domain-validated pixel, please enter the domain name of the site on which you want to implement the pixel. Please exclude the https:// and www.

  • You will now see two boxes containing DNS records that you need to add to your DNS settings with your hosting provider.

  • Simply copy and paste the content of the fields by clicking on the copy icon next to it and adding them to the DNS settings.

  • Open the collapsed section so the the necessary entries for your domain's DNS settings.

  • If you are not familiar with how to do that, please reach out to the Klar support via the chat. We are happy to assist you.

2. Shopify/WebGo/All Inkl/Strato hosted domain

The “name” field for the two entries usually looks something like this:

123456789.your-shop.com

However, the domain validation process for Shopify only works if you are excluding your domain in the name field. So, make sure that you edit the name field the following way:

CNAME:

WRONG: 123456789.your-shop.com

RIGHT: 123456789

CNAME IPV4:

WRONG: 123456789-4.your-shop.com

RIGHT: 123456789-4

  • After the records have been added it can take anywhere from a few hours up to 2 days in extreme cases for the entries to be validated. You can click the Verify Integration button to do that. Once verified, a green check icon will appear next to the record.

  • Once all entries have been validated, a third box called Tracking Script will appear that contains your tracking script which you need to implement on your site.

3. Implementing the Klar Pixel legacy script in your Shopify store

Now that you have your tracking script, it's time to implement it on your store.

  • Press the Copy Script button next to your script to copy it

  • Go to your Shopify store and click on Online Store on the left side menu and then Themes in the drop down.

  • Press the three dots, next to the green customize button and select Edit Code in the drop-down that appears.

  • Select theme.liquid from the left side menu.

  • Paste your tracking at the very top, just after the opening tag of the header.

  • Press Save

First part is done. 💪 Now, you also need to add the script to your checkout. That will only take a second.

  • Go to Settings at the bottom left of your Shopify side menu.

  • On the newly opened page, click on Checkout on the side menu.

  • Scroll down to the Order Status Page & Post-purchase page section and paste the tracking script to the top of the Additional Scripts field.

  • Press Save and you are done

4. Adding Data Privacy Snippets

Make sure to add our data privacy snippet in your privacy policy to inform your customers about the usage of Klar’s tracking pixel. You can find a German and English snippet in the Pixel datasource within the “Data Protection Snippet” section.

5. Implementing Klar URL Parameters

To ensure that conversions and costs can be matched as accurately as possible, you need to implement the pre-defined Klar tracking codes in your ad accounts.

Here are guides on how to do that for each marketing channel:

What Happens Next?

Starting now, we will be able to track visitors on your site and their purchase activity to power our attribution reporting.

Starting tomorrow you will start seeing data in your reports but only from the point in time you added the script.

Did this answer your question?