• Resolved sunnyoakslakebastrop

    (@sunnyoakslakebastrop)


    Problem: Site Kit code snippets are not being injected into the header

    I have been working on setting up all my google accounts for our new site. I have console, tags, analytics (UA and GA4), ads, etc… all setup under the same account and following a few tutorials, I have linked them together. These are now all tied to my self hosted Site Kit plugin. I have disconnected and I have removed all data. I have triple checked all account ID codes. I had cleared caches and disabled cache plugins. Under the Analytics tab in the settings, I have added the GA4 property and I have added the Ads Conversion ID. It says that “Snippet is inserted” but they are not. I am at my wits end here.

    Site Kit shows analytic data in my WP dashboard. I can login to google and see analytic data. Ad words is working. As best as I can tell, google tag manager is setup with all the correct details and I have published them multiple times to be sure. With all this said, code snippets are not being injected into the header.

    When I view page source, within the head tag I see this:

    <!-- Google Analytics opt-out snippet added by Site Kit -->
    <!-- End Google Analytics opt-out snippet added by Site Kit -->
    <!-- Google Analytics snippet added by Site Kit -->
    <!-- End Google Analytics snippet added by Site Kit -->
    <!-- Google Tag Manager snippet added by Site Kit -->
    <!-- End Google Tag Manager snippet added by Site Kit -->

    There is no code snippets between the comments! Just blank space…

    Using https://tagassistant.google.com/, I get an error, “Could not connect to sunnyoakslakebastrop.com” and “A timeout occurred while attempting to connect to https://sunnyoakslakebastrop.com

    Directly below the /head tag I get this:

    <!-- Google Tag Manager (noscript) snippet added by Site Kit -->
    <noscript>
    <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MLRL954" height="0" width="0" style="display:none;visibility:hidden"></iframe>
    </noscript>
    <!-- End Google Tag Manager (noscript) snippet added by Site Kit -->

    So I know its kind of working but not completely.

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

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

    (@jamesosborne)

    Hi there @sunnyoakslakebastrop,

    Sorry to hear you’re having trouble setting up the various tags on your site. From inspecting your site I can see the Site Kit added comments are as you mention detached from the Site Kit inserted snippets. I suspect this may be the result of a caching or optimization plugin configuration or feature. Many such features can move such snippets to the footer of a users site, despite this not being the most suitable position as per Google Analytics, Tag Manager and other service recommended guidelines.

    So we can determine more on this please share your Site Health information. You can use this form to share privately if preferred.

    You may also wish to use the Health Check and Troubleshooting plugin to see if the snippet modifications appear when checking your source code with only Site Kit active in troubleshooting mode.

    Note also that I can see your site is being tracked via Analytics when using the same tagassistant.google.com service. We will hopefully be able to determine the source of the snippet modification once you share the above.

    Thread Starter sunnyoakslakebastrop

    (@sunnyoakslakebastrop)

    Thank you for taking the time to look at this. I have sent you a copy of my site health. I am in the process of using the health check plugin now and will add anything I find with it.

    Note also that I can see your site is being tracked via Analytics when using the same tagassistant.google.com service. We will hopefully be able to determine the source of the snippet modification once you share the above.

    Yes, analytics seems to work fine. I’m finally getting some data now on my new GA4 prop page. I’m concerned about all of this because I’m trying to be sure I’m tracking data from my G Ads that are running. I don’t think Site Kit is properly injecting info from my Tag Manager account.

    When I use the https://tagassistant.google.com/ for our site, the smaller centered window says, “Could not connect to sunnyoakslakebastrop.com” and “A timeout occurred while attempting to connect to”. Behind this centered window, at the top left it says, “Not Connected” and 0 Google containers found.

    Plugin Support James Osborne

    (@jamesosborne)

    Many thanks for the update. I’ve checked your Site Health information and it does look like you have a couple of optimization plugins active. Let’s try see if there may be a configuration with either of these resulting in the non standard snippet placement.

    In order to do so please temporarily deactivate both the W3 Total Cache and Jetpack Boost plugins. After doing so let me know and I’ll review your site. You can also check your sites source code yourself, at which point you may see the Site Kit inserted snippets contained within the respective comments.

    When I use the https://tagassistant.google.com/ for our site, the smaller centered window says, “Could not connect to sunnyoakslakebastrop.com” and “A timeout occurred while attempting to connect to”. Behind this centered window, at the top left it says, “Not Connected” and 0 Google containers found.

    That’s interesting. Can you check this from a Chrome browser incognito window and let me know how you get on? I ask as I’m able to view your tags using this service at present.

    Thread Starter sunnyoakslakebastrop

    (@sunnyoakslakebastrop)

    In order to do so please temporarily deactivate both the W3 Total Cache and Jetpack Boost plugins. After doing so let me know and I’ll review your site. You can also check your sites source code yourself, at which point you may see the Site Kit inserted snippets contained within the respective comments.

    I currently have both plugins disabled and the snippets are still not within any of the Site Kit comments. I will leave them disabled for now. All of this may be for nothing though because your suggestion below allowed me to check the site.

    That’s interesting. Can you check this from a Chrome browser incognito window and let me know how you get on? I ask as I’m able to view your tags using this service at present.

    Incognito allowed me to use the tag assist site now. I use chrome as a default browser. So odd that I couldn’t connect in a normal browser but incognito works just fine. I can now see that everything seems to working even though the snippets are not right and a normal chrome browser doesn’t connect.

    Thread Starter sunnyoakslakebastrop

    (@sunnyoakslakebastrop)

    Ok, I gave the site a few minutes and now the snippets are being placed in the right spot. Jet pack was the problem. When I network disabled, the site still had them enabled. I cleared browsers and now they are working.

    Plugin Support James Osborne

    (@jamesosborne)

    Great to hear it, nice troubleshooting with clearing your browsers cache. We’ll perform some checks on our side using the same plugin. As mentioned above some plugins may modify the default placement or behavior of the Site Kit inserted snippets. In your case the Site Kit placed Analytics snippets were tracking as expected however they were relocated from the Google Analytics recommended position.

    Great also to hear that you were able to confirm all was working with the tagassistant.google.com service from an incognito browser window. There may have been a browser feature blocking such as an extension blocking tracking.

    If you run into any further queries be sure to get in touch.

    Plugin Support James Osborne

    (@jamesosborne)

    @sunnyoakslakebastrop Just to let you know that I’ve tested Jetpack and once the Jetpack Boost add on is activated, and if the “Defer Non-Essential JavaScript” configuration is applied this does result in the non standard placement of the Google Analytics snippet added via Site Kit.

    This is very useful to know should other users encounter the same. Thanks for reporting!

    If you have any further Site Kit queries be sure to get in touch.

    Thread Starter sunnyoakslakebastrop

    (@sunnyoakslakebastrop)

    Awesome you were able to replicate the issue. Everything seems to be working fine now. Thank you very much for taking the time to look at this with me.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Site Kit not adding snippet’ is closed to new replies.