• Resolved alFrame

    (@alframe)


    Hey there, New data protection act came into action here in Switzerland. We all need to put cookie blockers on every website…

    I use a plugin called Real Cookie Banner in paid mode. It detects following code which is apparently injected by the SiteKitPlugin:

    <!-- Google Analytics snippet added by Site Kit -->
    <script src='https://www.googletagmanager.com/gtag/js?id=UA-ABCDEFGHI-A' id='google_gtagjs-js' async></script>
    <script id="google_gtagjs-js-after">
    window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}
    gtag('set', 'linker', {"domains":["blueten-bijou.ch"]} );
    gtag("js", new Date());
    gtag("set", "developer_id.dZTNiMT", true);
    gtag("config", "UA-ABCDEFGHI-A", {"anonymize_ip":true});
    </script>

    *UA number redacted

    Real Cookie Banner did not recognize the Google Tag Manager as a blockable service. It detected the injected code.

    And yes, Google Tag Manager was not connected.

    After fiddling with it, I managed to get the Google Tag Manager to connect correctly. Which is actually something I never wanted. I am only interested in Analytics. Nothing more! But I thought, maybe the injected code goes away and Real Cookie Banner detects the Tag Manager correctly, so I can create a content blocker using the Plugin.

    Real Cookie Banner did detect the service correctly after connecting it correctly.

    Unfortunately the code is still in the pages and also detected by the Real Cookie Banner.

    Could it be that the code injection is coming form an older version of Site Kit? Could it be, I did search, believe me, that I injected the code somewhere? But why would I add “Site Kit” in the comment??

    Anyways, I have tis on all my sites. And so far the resolution was to completely disconnect and delete the analytics account. Which I would like to omit in the future and resolve this now and for ever ??

    Thanks for consideration & Cheers

    -Alex

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support James Osborne

    (@jamesosborne)

    Hi Alex,

    The code snippet you shared is a Google Analytics code snippet, inserted via Site Kit as you pointed out. It may appear that it’s a Tag Manager code snippet due to the googletagmanager.com resource used for the gtag placement, however, I can confirm that this is a Tag Manager snippet, as per this Analytics guide. You’ll also notice the different between the code snippet placed via the Tag Manager module placed via Site Kit, to the Analytics code snippet placed via Site Kit, by visiting the below guide:
    https://sitekit.withgoogle.com/documentation/using-site-kit/site-kit-modules-and-your-sites-source-code/

    Could it be that the code injection is coming form an older version of Site Kit? Could it be, I did search, believe me, that I injected the code somewhere? But why would I add “Site Kit” in the comment??

    Code snippets can certainly remain on a site if using a caching plugin, however, I can confirm that the code snippet you shared is normal.

    Let me know if you have any further questions with the above and I’d be happy to assist.

    Thread Starter alFrame

    (@alframe)

    Hi James,

    Thanks for getting back! No caching in place here. If I disable the Site Kit plugin, all code is gone.

    I am a bit confused. I can clearly see the difference between the two code bits. But I can only get rid of the one I posted above, by disabling the plugin.

    imho, if I set the Google Tag manager to not inject any code in Site Kit, it should NOT inject ANY code. But… the bit from my initial post remains…

    How can I get rid of it? Can you expose that in the options?

    Also, the snippet I posted above is looking for “UA-“, the other, which I can disable in the options, is targeting “GTA-“. Isn’t “UA-” deprecated?

    Thanks,
    -Alex

    EDIT: Even when the Google Tag Manager is disconnected in the settings, that code bit remains…

    • This reply was modified 1 year, 4 months ago by alFrame.
    Plugin Support James Osborne

    (@jamesosborne)

    Appreciate the update @allFrame.

    imho, if I set the Google Tag manager to not inject any code in Site Kit, it should NOT inject ANY code. But… the bit from my initial post remains…

    How can I get rid of it? Can you expose that in the options?

    The code snippet you shared it from Analytics. It’ an Analytics code snippet, the code below:

    <!-- Google Analytics snippet added by Site Kit --> <script src='https://www.googletagmanager.com/gtag/js?id=UA-ABCDEFGHI-A' id='google_gtagjs-js' async></script> <script id="google_gtagjs-js-after"> window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);} gtag('set', 'linker', {"domains":["blueten-bijou.ch"]} ); gtag("js", new Date()); gtag("set", "developer_id.dZTNiMT", true); gtag("config", "UA-ABCDEFGHI-A", {"anonymize_ip":true}); </script>

    It’s therefore normal that if you disconnect the Tag Manager module, that this code snippet will remain. As mentioned above, despite a googletagmanager reference in that code snippet, it is a valid Google Analytics snippet.

    The code snippet placed via Tag Manager can be found here (if using Site Kit to place this code snippet)

    With regards removing it, you can simply disconnect the Analytics module if you wish. While this will result in no Analytics data gathering for your site, you can place your Analytics snippet manually if you wish, with only a GA4 snippet. Note that this snippet will also include a googletagmanager reference (which is not via Site Kit).

    EDIT: Even when the Google Tag Manager is disconnected in the settings, that code bit remains…

    The Analytics code will remain as long as the Google Analytics module is connected and the option for Site Kit to insert this snippet is active. It’s independent to Tag Manager.

    Note also that before each Google Analytics and/or Tag Manager code snippet, there is some comments added to a users source code to help indicate where this code is coming from, see below (or this guide previously shared above):

    • Analytics: <!– Google Analytics snippet added by Site Kit –>
    • Tag Manager: <!– Google Tag Manager snippet added by Site Kit –>

    Let me know if you have any further questions with the above.

    Thread Starter alFrame

    (@alframe)

    Hi James,

    Yeah, disconnecting and uninstalling Site Kit, as this is not compatible with the Swiss data protection act.

    Cheers,
    Alex

    Plugin Support James Osborne

    (@jamesosborne)

    Sorry to hear that Alex. There are some plugins that can be used to customize how Analytics may fire on your website. Some of these can alter any Site Kit placed code snippets on your site. You’ll find more on this below:

    https://sitekit.withgoogle.com/documentation/using-site-kit/gdpr-compliance-and-privacy/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘SiteKit injects tag manager code’ is closed to new replies.