• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Google Tag Manager

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Google Tag Manager

This topic is: not resolved

Tagged: functions, google, google tag manager, plugins

  • This topic has 11 replies, 6 voices, and was last updated 10 years, 4 months ago by andrea12091980.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • May 14, 2014 at 11:02 am #105126
    osalcedo
    Participant

    Does anyone have any idea how to get Google Tag Manager to work properly in a genesis theme??
    No matter what I do, it simply won't work.
    Google Webmaster Tools keeps returning the following error... "The Google Tag Manager snippet on your site is in the wrong location."
    I've tried several plugins after trying the following code snippet in a functions.php file...

    add_action('genesis_before', 'google_tag_manager');
    function google_tag_manager() { ?>
    <!-- Google Tag Manager -->
    PASTE GOOGLE CODE MANAGER CODE HERE
    <!-- End Google Tag Manager -->
    <?php
    }

    Any help would be greatly appreciated 🙂

    May 15, 2014 at 12:48 am #105233
    nutsandbolts
    Member

    Hmm, the snippet you posted should work, assuming you're pasting the tag manager code in the middle where it asks for it.

    Who is your host? Are you running any kind of caching plugin and/or Cloudflare on the site? Using a CDN? Any of those may prevent WMT from finding the tag manager code.


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    August 27, 2014 at 6:40 pm #121445
    nhinternetsolutions
    Member

    I have been unable to add the Google Tag Manager snippet to the Freelance Child Theme. Not using any Caching, CloudFlare or a CDN...

    Ideas?

    August 27, 2014 at 6:45 pm #121446
    nutsandbolts
    Member

    Can you post a link to your site? It's always easier to help if we can see what you see, especially if the tag function is still in place.


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    August 4, 2015 at 4:12 pm #161438
    cavemedia
    Member

    Add Genesis Simple Hooks plugin to your wordpress.

    Then add the code to area that says:

    genesis_before Hook

    This hook executes immediately after the opening <body> tag.

    September 10, 2015 at 8:19 am #165110
    christianmejlak
    Member

    Was this resolved

    I am having the same problem, I normally use the Simple Hooks but for some reason its not working. It shows and works ok if I am logged in the admin and preview the site.

    I tried using this code in funtions.php through ftp and still didn't work. Any ideas would be appreciated:)

    September 25, 2015 at 6:43 am #166629
    andrea12091980
    Member

    Hello.
    I'm facing the same problem with Outreach Pro theme.
    Using Simple Hooks, I just added my GTM code in "genesis_before Hook" field, but no way... I mean no data entry at all on Google Search Console panel...

    September 25, 2015 at 6:48 am #166631
    christianmejlak
    Member

    Andrea try turning wpsupercache off or any other caching plugin you might have and check if it works

    September 25, 2015 at 7:27 am #166633
    andrea12091980
    Member

    Actually these are all the plugin installed:

    Akismet
    Black Studio TinyMCE Widget
    Genesis eNews Extended
    Genesis Responsive Slider
    Genesis Simple Edits
    Genesis Simple Hooks
    MailChimp for WordPress Lite
    Notifica Cookie
    Page Builder by SiteOrigin
    Simple Social Icons
    Simply Exclude
    SiteOrigin Widgets Bundle
    TablePress
    UpdraftPlus - Backup/Restore
    Yoast SEO

    Do you know if any of these someway conflicts with the GTM code?

    September 25, 2015 at 7:30 am #166634
    christianmejlak
    Member

    Is this a live web if so send url

    September 25, 2015 at 7:39 am #166638
    andrea12091980
    Member

    Yes it is.

    HOME

    September 28, 2015 at 4:03 am #166824
    andrea12091980
    Member

    Everything works fine now. It was just a matter of time, G robot seems to catch all the data.
    So the best choice is to use Simple Hooks and insert the GTM code after <body> tag, that's it.
    Thank you 🙂

  • Author
    Posts
Viewing 12 posts - 1 through 12 (of 12 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble