• Resolved mcascardi

    (@mcascardi)


    Hi I’m a website administrator and I’ve set up a lot of WordPress sites before. As we all know AMP is a great specification that let’s us serve content faster to mobile users.

    I have installed the standard suite of plugins to my site, including Google Site Kit as well as the official AMP plugin for WordPress. I see that I don’t have a viable analytics tag on my site, even though I set this up as best I could in the AMP plugin.

    Would it be possible to add support for proper AMP analytics out of the box with Google Site Kit? Let me know if this is something you could do, or if you have a guide that you recommend so I can at least get my site set up properly.

    Thanks so much

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

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

    (@jamesosborne)

    @mcascardi Good question. If you’re using Site Kit to place your Analytics snippet it places the snippet for all AMP URLs also. It places the snippet in all available modes, including standard mode which it looks like you have active.

    While I also don’t see the Site Kit placed Analytics snippet on your site might be worth checking your other plugins with Analytics integrations. I can see alternative Analytics tracking snippets on some of your product pages.

    If you’d like to share your Site Health information and we can troubleshoot this issue and hopefully determine the cause. You can share privately if preferred.

    Thread Starter mcascardi

    (@mcascardi)

    Hi, thanks for the response.

    I submitted the response with the site health information to the Google Form.

    The product pages you are seeing are not on the same server and are on a different website platform. I am speaking only in terms of “pages.lesliefrancesca.com” which is the wordpress site.

    I suppose it is fair to mention I am also using this with Yoast SEO plugin. The only other plugin I saw to use to integrate these things was “Glue for Yoast SEO and AMP” plugin which it claims is obsolete now between the updates to the AMP plugin.

    I intend to run the site with Google Site Kit, AMP, Yoast SEO, and W3 Total Cache in the end, and would love to see Google Site Kit working well together with these other outstanding plugins.

    Thanks so much,

    Matt

    @mcascardi thanks for the details!

    Interestingly, your Site Health shows that Site Kit’s Analytics snippet is inserted, but I’m also not seeing this or the snippet inserted via the AMP plugin in the source code of the site. Both are ok to use.

    I see that I don’t have a viable analytics tag on my site, even though I set this up as best I could in the AMP plugin.

    In this scenario, Site Kit would detect the AMP plugin’s snippet and would not insert its own.

    Let’s troubleshoot further. Could you:

    1) Remove the Analytics JSON code you placed in the AMP plugin (under AMP > Analytics)

    2) Reset Site Kit and reconnect the Analytics service

    3) Clear any cache (plugin and host provided)

    We’ll check the source code again to ensure the Analytics snippet is inserted.

    Thread Starter mcascardi

    (@mcascardi)

    Hi Renee,

    I did as you said.

    Removed the Analytics JSON code from AMP plugin.
    Reset Google Site Kit
    Removed any references or leftover files from cache plugins

    I still don’t see any amp-analytics tag. I can tell you from the error logging I did to try and debug that the print_amp_gtag() function is not firing inside of includes/Modules/Analytics.php which it looks like that is where the tag is generated from.

    Thanks for your help

    @mcascardi thanks for the attempt and update!

    I see you’re using a custom child theme. Are you aware of any modifications that may affect the way scripts are added to the the page that are different from the parent theme?

    Site Kit relies on standard hooks to print its scripts in the front end (wp_head, wp_footer for example).

    Can you safely switch to a default theme or do you have a test site to check if the scripts are inserted?

    Thread Starter mcascardi

    (@mcascardi)

    Hi,

    Thanks for the reply. I created the custom theme with twentytwenty as a base. I was able to test on a development copy of the site and switch the theme back to the parent and it worked.

    I went through the header.php and footer.php for hooks that I didn’t have in my child theme.

    <?php wp_body_open(); ?> and <?php wp_footer(); ?> needed to be added to my child theme for the hooks to fire and print the script tags.

    Thanks for the help!

    @mcascardi great troubleshooting! Glad you got it resolved. Feel free to leave a review about your experience with Site Kit.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Add integration for AMP support with official AMP plugin’ is closed to new replies.