HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/web/matomo.circ/plugins/TagManager/Template/Tag/GoogleAnalytics4Tag.web.js
(function () {
    return function (parameters, TagManager) {
        this.fire = function () {

            var measurementId = parameters.get("measurementId");

            var gtmScript = document.createElement("script");
            gtmScript.src = `https://www.googletagmanager.com/gtag/js?id=${measurementId}`;
            gtmScript.async = true;

            var gaScript = document.createElement('script');
            gaScript.textContent = `
              window.dataLayer = window.dataLayer || [];
              function gtag(){dataLayer.push(arguments);}
              gtag('js', new Date());
              gtag('config', '${measurementId}');
            `;

          document.head.appendChild(gtmScript);
          document.head.appendChild(gaScript);

        };
    };
})();