Install website tracking with Google Tag Manager
Watch a video walkthrough:
Step 1: Get Started with Tracklution
First, get started at www.tracklution.com by creating an account and providing your website URL to create a Tracking Container for your site inside Tracklution.
Step 2: Implement the Main Script and PageView in GTM
Open Google Tag Manager (GTM) and add a new tag.
Choose a Custom HTML as the tag type.
Copy and paste your unique main script into the HTML field. The script for your Tracking Container can be found in your personalized Tracklution Installation Guide. The installation guide is available in the Installation tab for each tracking container.
Choose a trigger. The tag should fire before anything else, commonly referred to as Consent Initialization - All Pages, Initialization - All Pages, or All Pages, depending on your GTM settings.
Name the tag clearly (e.g., Tracklution - Configuration) and hit Save.
If your cookie banner is integrated with GTM’s built-in Consent Mode, Tracklution will automatically read and adapt to the consent status from the data layer. This is enabled by default. No further action is required. For manual consent integration, refer to the documentation on implementing Cookie Consent manually.
Step 3: Implement Conversion Event
This step allows you to track Converions on your site. The example we are going to use is a Purchase event, but you can track any conversion you want.
- Create a new tag in GTM and name it descriptively, for example: Tracklution - Event - Purchase.
- Choose Custom HTML tag type and copy-paste your Purchase event script to the field.
<script> tlq('track', 'Purchase', { value: 75.10, currency: 'EUR' }); </script> <script> tlq('set', 'ContactInfo', { email: 'example@email.com', phoneNumber: '+358501234567', firstName: 'David', lastName: 'Smith', birthday: '1985-06-17', gender: 'male', address: 'Street 1', postCode: '11015', city: 'Berlin', country: 'Germany', externalId: '123-91197003219' }); </script> - Replace the variables in the script (value, currency, and other parameters) with the actual variables from your own GTM data layer variables to catch the purchase information correctly.
- Remove the example Purchase value (75.10) and start typing {{. You will see a dropdown menu where you find the Data Layer Variables. Choose the correct variable for Purchase value.
- Change the currency the same way if you handle multiple currencies, or just type the fixed currency code (e.g. USD) in case of a single currency site.
- Ensure you don’t accidentally remove the single quotation marks (‘) around the currency variable and other string fields (all the text fields).
- What if I don't have data layer variables? (Nothing relevant pops up when I start typing {{) Please contact your Google Tag Manager administrator / web developer. Here's Google's article on how to create custom variables in GTM. https://support.google.com/tagmanager/topic/9125128
- (Optional but recommended) Tracking Enhanced Conversions with ContactInfo tag
- As you see, in addition to the usual Purchase information, there is also the “ContactInfo” part. ContactInfo tag is usually implemented together with the Purchase tag, or similar conversion action that has user data available. This will enable tracking Enhanced Conversions and matching website data to offline data.
- Data fields available: email, phoneNumber, firstName, lastName, birthday, gender, address, postCode, city, country, externalI.All other fields are user-related data, but if there is an order ID or similar unique ID generated together with a purchase, it can be placed in the “externalID” field. This will help you later import order data via webhook, if you want to enable that (e.g. additional details such as profit margin data).
- You can use all of these details or pick which ones you wish to use. Remove the rows you don’t use, but it is recommended to keep at least the email address and phone number to enable conversion attribution. If you delete any rows, make sure there is no comma after the last row (in the example screenshot, comma is removed after the ‘externalId’ row). The more data points you have, the more accurate your data and attribution will be and it reflects positively to your marketing efforts.
- If you don't want to track ContactData at all, remove this part of the tag:
<script> tlq('set', 'ContactInfo', { email: 'example@email.com', phoneNumber: '+358501234567', firstName: 'David', lastName: 'Smith', birthday: '1985-06-17', gender: 'male', address: 'Street 1', postCode: '11015', city: 'Berlin', country: 'Germany', externalId: '123-91197003219' }); </script> - Implementing Enhanced Conversions isn't strictly necessary but highly recommended to maximise your server-side tracking benefits:
- Enable Advanced Features: Unlock capabilities like Enhanced Conversions (Google Ads) and Advanced Matching (Meta). This includes cross-channel remarketing without relying on third-party cookies, capturing otherwise lost conversions (e.g., from missing click IDs), identifying returning users, and enhancing marketing campaign data for better performance.
- Integrate External Data: Easily incorporate data from other systems, such as tracking offline conversions, through efficient matching via Webhook delivery to Tracklution.
- Your Data Remains Yours: As a technology provider, we emphasise that your data is exclusively yours. Our access is strictly confined to what's necessary for delivering server-side tracking, without any claim to your data.
- Correct Tag Sequencing
- Open Advanced Settings and click Tag Sequencing.
- The Tracklution Configuration tag that you created in the first step has to be always fired before any event tags.
- Choose the Fire a tag before [this event] fires, and in the Setup Tag dropdown, choose the “Tracklution - Configuration” tag you created in the first step.
- Add a Trigger (usually something around Purchase or e.g. Thank you page):
- Missing triggers? See more details on How to create triggers in GTM: https://support.google.com/tagmanager/answer/7679316
As the last step, remember to save the tag!
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).
Validate your setup
Once you have installed all events, you can validate your installation with these instructions: Tracklution Dashboard: Event Validation & Debugging