• Resolved mikdac

    (@mikdac)


    I’ve just re-installed Site Kit to this site and connected to both Analytics and Tag Manager. When I look at the source I see, right at the top under <head> some code that to me seem to disable, instead of enable, google tag manager:

    <script type="text/javascript">
    window["ga-disable-UA-myUAId"] = true;
    </script>
    			<script type="text/javascript">
    window["ga-disable-G-myGA4Id"] = true;
    </script>
    

    Many lines below I see the Tag Manager code snippet that I expected to see.

    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','myTagId');</script>
    <!-- End Google Tag Manager -->

    Have I misunderstood something, or have Site Kit actually disabled any Tag Manager functionality by the first part? I am a bit confused.

    Best regards,
    Mikael

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

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support Adam Dunnage

    (@adamdunnage)

    Hello @mikdac thanks for your question. This disable code snippet is not placed by Site Kit and in the past we have seen this placed by other third party plugins. To help you further with this please could you provide your Site Health information. You can use this form to share privately if preferred. If using the form please include your current hosting provider where requested.

    Thread Starter mikdac

    (@mikdac)

    Hi @adamdunnage, thank so much for reaching out. I’ve provided the Site Health info using the form. I just thought I should share some more code from the top most part the page. It really looks like it is Site Kit adding these lines when you just read the code/comments:

    <!-- Kodblock f?r fr?ns?gning av ”Google Analytics”, tillagt av Site Kit -->
    			<script type="text/javascript">
    window["ga-disable-UA-200756347-2"] = true;
    </script>
    			<script type="text/javascript">
    window["ga-disable-G-5N7ZF76M0K"] = true;
    </script>
    			<!-- Avslut av kodblock f?r fr?ns?gning av ”Google Analytics”, tillagt av Site Kit -->

    My apologies for the Swedish language, but that is straight from the source, unedited by me, and probably due to the fact that the site language is Swedish. I assume the English comment read something like

    Code block for disabling of “Google Analytics”, added by Site Kit

    Hope this clarifies.

    • This reply was modified 2 years, 10 months ago by mikdac.
    Plugin Support Adam Dunnage

    (@adamdunnage)

    @mikdac have you since changed anything on your Site or with your Site Kit setup as viewing your page source I cannot see this “disable” section of the snippet. See here: view-source:https://askluft.com/.

    Can you still see it and if so could you let me know where?

    Thread Starter mikdac

    (@mikdac)

    @adamdunnage very strange, I definitely still see that section. At the very top of the source. Please see screenshot at https://imgur.com/a/gVP6XKR

    • This reply was modified 2 years, 10 months ago by mikdac.
    Thread Starter mikdac

    (@mikdac)

    @adamdunnage, Your reply made me check with other browsers. And there the disabled snippet was no more. I went further and cleared all cached data in my Chrome browser and now the snippet is gone there as well. Thank you (without your comment it would have taken me quite some more time to figure this out).

    • This reply was modified 2 years, 10 months ago by mikdac. Reason: Marked as resolved
    Plugin Support Adam Dunnage

    (@adamdunnage)

    @mikdac Glad to hear this has resolved your issue and no problem at all! Good luck with your site and please do let us know if you encounter any further issues or have any questions and we will be happy to help!

    I had the same problem, and it was driving me nuts. Glad I found this thread, which set me on the right track.

    I think the real source of the problem is that, for logged in admin users, we don’t want to collect Analytics data, so Site Kit adds the “ga_disable” code. The code goes away if you’re not logged into the WordPress site.

    • This reply was modified 2 years, 5 months ago by fssbob.
    Plugin Support James Osborne

    (@jamesosborne)

    Glad to hear it @fssbob!

    You’ll find options to enable/disable tracking for logged in users or users who can write posts within Site Kit’s Google Analytics settings.

    You’ll find the settings under “Site Kit > Settings > Connected Services > Analytics > Edit“, all from within your WordPress dashboard.

    I think the real source of the problem is that, for logged in admin users, we don’t want to collect Analytics data, so Site Kit adds the “ga_disable” code. The code goes away if you’re not logged into the WordPress site.

    Exactly. This is the reason this configuration is enabled by default. You’ll only be able to view code such as the below if logged in:

    @jamesosborne thank you!!!! This has been driving me crazy, such an easy config setting to miss

    Plugin Support James Osborne

    (@jamesosborne)

    Glad you found it useful @connorb!

    If you have any questions on this, or other Site Kit queries, be sure to reach out to us here in the forums. Thank you!

    driver49

    (@driver49)

    If I post a reply, will that drive this old thread to someplace where a higher authority will see it? I guess we’ll find out.

    I am in the middle of a crash course on the inner workings of WordPress, SEO, Analytics etc etc. I’ve been a WP ‘end abuser’ ?? for years but this is the first time I’ve looked past the dashboard.

    I was looking at the Source Code for one of my pages to see where the gtag.is snippet appears. Before I found that snipped – on line 2337!), I found this snippet near the top:

    <!-- Google Analytics opt-out snippet added by Site Kit -->
        <script>
        window["ga-disable-UA-249098151-1"] = true;
        </script>
        <script>
        window["ga-disable-G-00JP2ZQGR5"] = true;
        </script>
        <!-- End Google Analytics opt-out snippet added by Site Kit -->

    Now, I THOUGHT I had configured something in Site Kit to tell Google to ignore when I visit my own site: I found my specific IP address and entered that into an “exclusion” panel somewhere in SiteKit (I think).

    I thought that ‘ga-disable’ snippet was ONLY for my IP, but I Googled:

    “Google Analytics opt-out snippet added by Site Kit”

    …and the answer that came up is:

    “The add-on prevents the Google Analytics JavaScript (gtag. js, analytics. js) that is running on websites from sharing information with Google Analytics about visit activity.”

    Which SEEMS to infer that this ‘opt-out’ snippet is superseding the gtag snippet 2300 lines down for ALL visits, NOT just MY own visits.

    Further down that SERP, I found this thread, so rather than start a new one…

    Assuming this reply makes it to somebody’s browser, can you tell me if the ‘opt-out’ snippet is doing JUST what I want it to (hiding my own visits) or did I just inadvertently tell Google not to index my site?

    If the former, great. If the latter, then I still need help with the former.

    Make sense?

    Thanks,

    –PS

    • This reply was modified 2 years ago by driver49. Reason: left out one line
    Plugin Support Adam Dunnage

    (@adamdunnage)

    @driver49 If you have an issue or question with Site Kit then please could you open your own support topic as per the forum guidelines and we can assist you individually there, thanks.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Why does site kit add disabling code at the top?’ is closed to new replies.