___TERMS_OF_SERVICE___

By creating or modifying this file you agree to Google Tag Manager's Community
Template Gallery Developer Terms of Service available at
https://developers.google.com/tag-manager/gallery-tos


___INFO___

{
  "type": "TAG",
  "id": "cvt_temp_public_id",
  "version": 1,
  "securityGroups": [],
  "displayName": "Web-Tracking.eu",
  "categories": ["ANALYTICS", "MARKETING"],
  "brand": {
    "id": "brand_dummy",
    "displayName": "Web-Tracking.eu",
    "thumbnail": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkAAIAAAoAAv/lxKUAAAAASUVORK5CYII="
  },
  "description": "Cookieless, GDPR-compliant analytics for the EU. Loads the Web-Tracking.eu script with your site ID. No cookie banner required.",
  "containerContexts": ["WEB"]
}


___TEMPLATE_PARAMETERS___

[
  {
    "type": "TEXT",
    "name": "siteId",
    "displayName": "Site ID",
    "simpleValueType": true,
    "valueValidators": [
      {
        "type": "NON_EMPTY"
      }
    ],
    "help": "Your site ID from the Web-Tracking.eu dashboard (Settings > Sites). Required."
  },
  {
    "type": "TEXT",
    "name": "excludePaths",
    "displayName": "Exclude Paths (optional)",
    "simpleValueType": true,
    "help": "Optional comma-separated list of URL path prefixes to exclude from tracking. Example: /admin,/preview"
  }
]


___SANDBOXED_JS_FOR_WEB_TEMPLATE___

const injectScript = require('injectScript');
const encodeUriComponent = require('encodeUriComponent');
const getUrl = require('getUrl');
const log = require('logToConsole');

const siteId = data.siteId;
const excludePaths = data.excludePaths || '';

// Skip if path is excluded
if (excludePaths) {
  const path = getUrl('path') || '';
  const prefixes = excludePaths.split(',');
  for (let i = 0; i < prefixes.length; i++) {
    const p = prefixes[i].trim();
    if (p && path.indexOf(p) === 0) {
      log('Web-Tracking.eu: path excluded:', path);
      data.gtmOnSuccess();
      return;
    }
  }
}

const url = 'https://web-tracking.eu/t.js?site=' + encodeUriComponent(siteId);

injectScript(url, data.gtmOnSuccess, data.gtmOnFailure, 'web-tracking-eu');


___WEB_PERMISSIONS___

[
  {
    "instance": {
      "key": {
        "publicId": "inject_script",
        "versionId": "1"
      },
      "param": [
        {
          "key": "urls",
          "value": {
            "type": 2,
            "listItem": [
              {
                "type": 1,
                "string": "https://web-tracking.eu/*"
              }
            ]
          }
        }
      ]
    },
    "clientAnnotations": {
      "isEditedByUser": true
    },
    "isRequired": true
  },
  {
    "instance": {
      "key": {
        "publicId": "get_url",
        "versionId": "1"
      },
      "param": [
        {
          "key": "urlParts",
          "value": {
            "type": 2,
            "listItem": [
              {
                "type": 1,
                "string": "path"
              }
            ]
          }
        },
        {
          "key": "queriesAllowed",
          "value": {
            "type": 1,
            "string": "any"
          }
        }
      ]
    },
    "clientAnnotations": {
      "isEditedByUser": true
    },
    "isRequired": true
  },
  {
    "instance": {
      "key": {
        "publicId": "logging",
        "versionId": "1"
      },
      "param": [
        {
          "key": "environments",
          "value": {
            "type": 1,
            "string": "debug"
          }
        }
      ]
    },
    "clientAnnotations": {
      "isEditedByUser": true
    },
    "isRequired": true
  }
]


___TESTS___

scenarios: []


___NOTES___

Created on 2026-04-10 by Web-Tracking.eu.
Loads https://web-tracking.eu/t.js with the configured site ID. The script is
under 2 KB, cookieless, and GDPR-compliant — no consent banner required.
Source: https://web-tracking.eu/install/gtm
