[Support request] Hooks settings page 404 with Google Tag Manager code

Home Forums Support Hooks settings page 404 with Google Tag Manager code

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #295686
    Dave Foy

    Hi there,

    I have an issue where when I save my GP Hooks settings, I get a front-end 404 page at /wp-admin/options.php

    It’s only when I add Google Tag Manager code to wp_head. Any other time the hooks settings save fine.

    I can add the exact same GTM code to any other hook – saves fine. It’s only the GTM code in wp_head. Any other code in wp_head saves fine too.

    Here it is:

    <!-- Google Tag Manager -->
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    <!-- End Google Tag Manager -->

    I’ve added GTM to hooks in several GP sites now, so it’s a bit baffling!

    I’ve tried completely removing all other code from the other hooks, saving the page, and then adding the GTM code to wp_head. I did this in case some other code in the other hooks is clashing or badly-formed. It still gives a 404.

    Have you any ideas how I can troubleshoot?

    Thanks for your help.

    GeneratePress 1.3.46
    GP Premium 1.2.96
    Lead Developer
    Lead Developer

    Just gave it a shot on my test site, didn’t have any issues.

    Technically, there’s no difference between each of those textareas – they all save and display the same, they’re just added into different areas.

    Have you tried deactivating your other plugins one by one to see if there’s a conflict?

    Dave Foy

    Thanks for the reply Tom. Sorry for the delay back!

    I deactivated every single plugin, all at once: still the same problem. πŸ™

    Erm… do you have any other debugging ideas?

    Thanks Tom.

    Lead Developer
    Lead Developer

    So it’s just this one site, but it’s not a conflicting plugin. Hmm..

    Anything else different about this site vs your others? Different hosting? Custom PHP? Other scripts added?

    Dave Foy

    Just reporting back on this one (it’s been a while!)

    I cloned the site to my local server – no problems there. I figured it must be something to do with the shared hosting environment this particular site is on.

    They tell me it was triggering a mod_security rule and needed whitelisting. Once done, all worked fine.

    Thought it might be helpful if anyone reports similar in future.

    Interestingly, when I tested this in Chrome earlier (before the fix), I now got the following error screen, not the 404:


    Anyway, pleased it’s all working now. πŸ™‚


    Lead Developer
    Lead Developer

    Glad to hear it’s all working now! Thanks for reporting back πŸ™‚

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.