Google Tag Manager Integration
This guide covers how to install the Konektor tracking script using Google Tag Manager (GTM) with an optimal configuration for performance and data accuracy.
Why Use GTM?
Using GTM allows you to manage tracking pixels (Meta, TikTok, Google Ads) in one place without editing your website code repeatedly. Konektor is designed to work seamlessly with GTM.
Mandatory Prerequisites
Before starting, ensure you have:
- Google Tag Manager Account: GTM container installed on your website (
<head>and<body>). - Workspace ID: Your unique Konektor workspace ID (Format:
WS-XXXX). - Publish Access: Permission to publish changes in GTM.
Step-by-Step Installation
Step 1: Create a New Tag
- Login to the Google Tag Manager dashboard.
- Open the Tags menu in the left sidebar.
- Click New.
- Name the Tag, for example:
Konektor - Base Code. - Click Tag Configuration, then select Custom HTML.
Step 2: Insert Konektor Script
Copy the code below and paste it into the HTML field:
<!-- Konektor Tracking Code - GTM Version -->
<script>
!function(w,d,t,u,k,a,m){w['KonektorObject']=k;w[k]=w[k]||function(){
(w[k].q=w[k].q||[]).push(arguments)},w[k].l=1*new Date();a=d.createElement(t),
m=d.getElementsByTagName(t)[0];a.async=1;a.src=u;m.parentNode.insertBefore(a,m)
}(window,document,'script','https://cdn.konektor.id/tracker.min.js','konektor');
// Initialize Konektor
konektor('init', 'WS-REPLACE-WITH-YOUR-ID', {
// Additional options (optional)
debug: false
});
konektor('track', 'PageView');
</script>
<!-- End Konektor Tracking Code -->
WS-REPLACE-WITH-YOUR-ID with the actual Workspace ID from your Konektor dashboard.Step 3: Check 'Support document.write'
Below the HTML field, switch to Advanced Settings:
- Check the Support document.write option.
- (Optional) In Tag Sequencing, configure this tag to fire before other tags (like GA4 or Meta Pixel) if you want to ensure Konektor is ready first.
Step 4: Set Priority Trigger
This is the most critical step to avoid race conditions.
- Click Triggering.
- Do NOT select "All Pages" (Page View).
- Select the Initialization - All Pages trigger.
Initialization trigger runs earlier than the standard Page View. This ensures the Konektor script is ready before ad scripts (Meta/Google Ads) attempt to send data, allowing for perfect data deduplication.Step 5: Save and Publish
- Click Save.
- Click Submit in the top right corner.
- Name the version (e.g., "Install Konektor"), then click Publish.
Verification
After publishing, verify everything is working correctly:
- Open your website in a new tab.
- Open Developer Tools (Right Click > Inspect > Console).
- Type
konektorin the console and press Enter. - If it returns a function response (not an
undefinederror), the script is loaded successfully. - Check the Konektor dashboard in Pixel Settings to ensure the status is Active.
Advanced Settings
Debug Mode
If you are setting up for the first time and want to see what data is being sent in the browser console, enable debug mode:
konektor('init', 'WS-YOUR-ID', {
debug: true // Data will appear in Browser Console
});
Setup Custom Domain
If you use a Custom Domain for the tracking script (recommended for anti-blocking), adjust the init code:
konektor('init', 'WS-YOUR-ID', {
// Enter your custom domain
customDomains: ['wa.yourbrand.com']
});
Troubleshooting
Tag Not Firing
- Check if you clicked Publish in GTM (Submit button). Changes in GTM are not live if only Saved.
- Ensure the selected trigger is correct (
Initialization - All Pages).
Data Not Showing in Dashboard
- Ensure Workspace ID is correct and contains no extra spaces.
- Check if any AdBlocker is active in your browser during testing.
Conflict with Other Scripts
- If the website feels slow, try using Tag Sequencing in GTM. Configure heavy scripts (e.g., Hotjar, Clarity) to run only after the Konektor tag finishes (Fire tag after Konektor).
Ad Pixel Integration (Meta, TikTok, Google)
Once the Konektor script is installed, you can use GTM to install other ad pixels. This keeps your website code clean.
1. Conversion Linker (Mandatory)
This guide is for special cases only (audit, legacy migration, or manual hybrid setup).
Before installing any pixel, it is VERY IMPORTANT to enable Conversion Linker. This tag helps store click data in first-party cookies, which is crucial for tracking accuracy (ITP/ETP prevention).
Installation Steps:
- In GTM, click Tags > New.
- Select Tag Configuration > Conversion Linker.
- Leave default settings (Enable linking on all page URLs).
- In Triggering, select Initialization - All Pages.
- Save as "Conversion Linker".
2. Google Analytics 4 (GA4)
GA4 is the foundation of modern Google tracking. It is recommended to install it before Google Ads tracking.
Installation Steps:
- Open Admin in your GA4 account, then Data Streams.
- Copy Measurement ID (format:
G-XXXXXXXXXX). - In GTM, create a new Tag: Google Analytics: GA4 Configuration.
- Paste your Measurement ID.
- Triggering: Select Initialization - All Pages.
- Save.
3. Meta (Facebook) Pixel
Although Konektor provides Server-Side (CAPI) integration, installing the Browser Pixel is still recommended for deduplication and maximum match quality (Hybrid Tracking).
Installation Steps:
- Custom HTML Tag: Meta does not have an official default template in GTM.
- Copy Base Code Pixel from Meta Events Manager.
- In GTM, create a Custom HTML Tag.
- Paste the Meta Pixel code.
- Triggering: All Pages (Page View).
- Save as "Meta Pixel - Base Code".
4. TikTok Pixel
Similar to Meta, the Hybrid approach (Browser + Server) provides the best results.
Installation Steps:
- Copy Pixel Code from TikTok Ads Manager.
- In GTM, create a Custom HTML Tag.
- Paste the TikTok Pixel code.
- Triggering: All Pages.
- Save as "TikTok Pixel - Base Code".
5. Google Ads Conversion Tracking
Google Ads has two main components: Remarketing and Conversion Action.
a. Google Ads Remarketing
- Create a new Tag: Google Ads Remarketing.
- Enter Conversion ID (from Tools > Audience Manager > Audience Sources).
- Triggering: All Pages.
b. Google Ads Conversion Action (e.g., Purchase/Lead)
This tag is ONLY installed when a conversion occurs (e.g., Thank You page, or Konektor Custom Event trigger).
- Create a new Tag: Google Ads Conversion Tracking.
- Enter Conversion ID and Conversion Label (from specific conversion action in Google Ads).
- Triggering: Use a specific trigger, e.g., URL contains
/thank-youor Custom Eventkonektor_conversion.
Enhanced Conversions
To enable Enhanced Conversions, you need to send user data variables (email, phone) to this tag. See documentation above for Data Layer integration.
Need More Help?
Our team is ready to help you maximize ad tracking and business attribution.
Try or continue
© 2026 Konektor. All rights reserved.
