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:

  1. Google Tag Manager Account: GTM container installed on your website (<head> and <body>).
  2. Workspace ID: Your unique Konektor workspace ID (Format: WS-XXXX).
  3. Publish Access: Permission to publish changes in GTM.

Step-by-Step Installation

Step 1: Create a New Tag

  1. Login to the Google Tag Manager dashboard.
  2. Open the Tags menu in the left sidebar.
  3. Click New.
  4. Name the Tag, for example: Konektor - Base Code.
  5. 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 -->
Make sure to replace 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:

  1. Check the Support document.write option.
  2. (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.

  1. Click Triggering.
  2. Do NOT select "All Pages" (Page View).
  3. Select the Initialization - All Pages trigger.
The 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

  1. Click Save.
  2. Click Submit in the top right corner.
  3. Name the version (e.g., "Install Konektor"), then click Publish.

Verification

After publishing, verify everything is working correctly:

  1. Open your website in a new tab.
  2. Open Developer Tools (Right Click > Inspect > Console).
  3. Type konektor in the console and press Enter.
  4. If it returns a function response (not an undefined error), the script is loaded successfully.
  5. 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)

By default, you do not need to install each platform pixel manually in GTM when using the latest Konektor snippet.
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:

  1. In GTM, click Tags > New.
  2. Select Tag Configuration > Conversion Linker.
  3. Leave default settings (Enable linking on all page URLs).
  4. In Triggering, select Initialization - All Pages.
  5. 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:

  1. Open Admin in your GA4 account, then Data Streams.
  2. Copy Measurement ID (format: G-XXXXXXXXXX).
  3. In GTM, create a new Tag: Google Analytics: GA4 Configuration.
  4. Paste your Measurement ID.
  5. Triggering: Select Initialization - All Pages.
  6. 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:

  1. Custom HTML Tag: Meta does not have an official default template in GTM.
  2. Copy Base Code Pixel from Meta Events Manager.
  3. In GTM, create a Custom HTML Tag.
  4. Paste the Meta Pixel code.
  5. Triggering: All Pages (Page View).
  6. Save as "Meta Pixel - Base Code".
If you use Konektor CAPI and Browser Pixel together, Konektor will automatically handle Event IDs for deduplication, as long as both Browser Pixel and CAPI are connected to the same Pixel ID.

4. TikTok Pixel

Similar to Meta, the Hybrid approach (Browser + Server) provides the best results.

Installation Steps:

  1. Copy Pixel Code from TikTok Ads Manager.
  2. In GTM, create a Custom HTML Tag.
  3. Paste the TikTok Pixel code.
  4. Triggering: All Pages.
  5. 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

  1. Create a new Tag: Google Ads Remarketing.
  2. Enter Conversion ID (from Tools > Audience Manager > Audience Sources).
  3. 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).

  1. Create a new Tag: Google Ads Conversion Tracking.
  2. Enter Conversion ID and Conversion Label (from specific conversion action in Google Ads).
  3. Triggering: Use a specific trigger, e.g., URL contains /thank-you or Custom Event konektor_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.

© 2026 Konektor. All rights reserved.