Home Forums WoodMart support forum Conflict between Woodmart Theme / Elementor Pro plugin / GTM code

Conflict between Woodmart Theme / Elementor Pro plugin / GTM code

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #575902

    vivoadv
    Participant
      Hello,

      We’re using Woodmart theme with Elementor as page builder, this is an eCommerce website with WooCommerce.

      We’re experiencing a strange issue: the website development is now complete and we’re now installing Google Tag Manager, however this breaks something and when the GTM code <noscript> is in the <body> the homepage can’t be edited (Elementor tries to load the editor but after few seconds it asks for safe mode to be enabled).

      GTM code (example):
      <!– Google Tag Manager (noscript) –>
      <noscript><iframe src=”https://www.googletagmanager.com/ns.html?id=GTM-XYZ&#8221;
      height=”0″ width=”0″ style=”display:none;visibility:hidden”></iframe></noscript>
      <!– End Google Tag Manager (noscript) –>

      Things we noticed so far:

      • When trying to edit the homepage, in the console there is this alert:
      Failed to load resource: the server responded with a status of 403 ()
      https://www.*****.ext/?elementor-preview=32&ver=1719310663
      This is not showing if we try to edit another page (no console errors and correct editor loading)

      • If the body tag of GTM is not pushed in to the body, everything works as expected.

      • If we push another code with <noscript> with an <iframe> we have the same issue. Example code:
      <!– TEST (noscript) –>
      <noscript>
      <iframe src=”https://www.w3schools.com&#8221; title=”W3Schools Free Online Web Tutorials”>
      </iframe>
      </noscript>
      <!– End TEST (noscript) –>

      Things we tried so far:

      • Deactivate cache and security plugins
      • Deactivate all plugins
      • Push GTM head and body code with the plugin GTW4WP (we use to adopt this plugin in every project):
      – Correct code placing
      – Footer code placing
      – Manual code placing
      • Push GTM body code with Elementor custom code
      • Push GTM body code with Woodmart custom JS
      • Push GTM body code inserting it in function.php

      Things we know fix the issue:

      • Change theme (with 2024, 2023, etc, issue is gone!!! Homepage edit works as expected!)

      The only solution we found is this one but it doesn’t fit our needs at all.

      We’re looking for a solution as the website has to go online!

    #575928

    Artem Temos
    Keymaster

    Hello,

    Could you please clarify where exactly you placed your custom code and send us some screenshots?

    Kind Regards

    #575972

    vivoadv
    Participant

    We tried to place the code in different places, I’ll send you screenshots of all the places.

    Elementor custom code:

    Our code has to be placed at the start of the body, right after <body>.
    We tried also to place it at the end and to place it at the end with JQuery enabled.

    Woodmart:

    Using custom JS feature we tried to push the script as first item after the opening of the <body> tag.

    Functions.php::

    Adding here a function that pushes our script in the body breaks the editing of the homepage.

    Additional infos:

    Using a dummy script we found out that the problem seems to show when in the <body> there is a tag like:

    <noscript>
    <iframe>…</iframe>
    </noscript>

    Attachments:
    You must be logged in to view attached files.
    #575979

    Artem Temos
    Keymaster

    Try to use the WPCode plugin and follow this tutorial https://wpcode.com/how-to-add-google-tag-manager-to-wordpress/

    #575994

    vivoadv
    Participant

    Using WPCode also breaks the homepage editing, like all others way we tried.
    In attachment a screenshot of the inspector console.

    Attachments:
    You must be logged in to view attached files.
    #576005

    Artem Temos
    Keymaster

    Please add the code now and temporarily disable all plugins that are not related to our theme. We will check the issue.

    #576008

    vivoadv
    Participant

    Done! Thank you and I await a reply.

    #576023

    Artem Temos
    Keymaster

    We don’t see the code added on your website at the moment. Can you please send us a screenshot where did you add it?

    #576026

    vivoadv
    Participant

    It is placed at the start of the body, right after <body> using Elementor Custom Code.

    Attachments:
    You must be logged in to view attached files.
    #576109

    Artem Temos
    Keymaster

    Please remove the code from there and use the method described in this article so we can check https://wpcode.com/how-to-add-google-tag-manager-to-wordpress/

    #576197

    vivoadv
    Participant

    It does not work!!! As you can see from our previous attachments, using WPCode breaks the editing of the homepage… however now the code is pushed through WPCode…
    Please give us a real solution, this is a project that has to go online soon. TY

Viewing 11 posts - 1 through 11 (of 11 total)