Home › Forums › WoodMart support forum › Conflict between Woodmart Theme / Elementor Pro plugin / GTM code
Conflict between Woodmart Theme / Elementor Pro plugin / GTM code
- This topic has 11 replies, 2 voices, and was last updated 10 months ago by
Artem Temos.
-
AuthorPosts
-
June 27, 2024 at 12:40 pm #575902
vivoadvParticipant-
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”
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” 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.phpThings 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!
June 27, 2024 at 2:17 pm #575928
Artem TemosKeymasterHello,
Could you please clarify where exactly you placed your custom code and send us some screenshots?
Kind Regards
June 27, 2024 at 4:09 pm #575972
vivoadvParticipantWe 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.June 27, 2024 at 4:19 pm #575979
Artem TemosKeymasterTry to use the WPCode plugin and follow this tutorial https://wpcode.com/how-to-add-google-tag-manager-to-wordpress/
June 27, 2024 at 4:31 pm #575994
vivoadvParticipantUsing 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.June 27, 2024 at 4:59 pm #576005
Artem TemosKeymasterPlease add the code now and temporarily disable all plugins that are not related to our theme. We will check the issue.
June 27, 2024 at 5:07 pm #576008
vivoadvParticipantDone! Thank you and I await a reply.
June 27, 2024 at 5:38 pm #576023
Artem TemosKeymasterWe don’t see the code added on your website at the moment. Can you please send us a screenshot where did you add it?
June 27, 2024 at 5:52 pm #576026
vivoadvParticipantIt 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.June 28, 2024 at 9:05 am #576109
Artem TemosKeymasterPlease 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/
June 28, 2024 at 1:42 pm #576197
vivoadvParticipantIt 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. TYJuly 1, 2024 at 9:45 am #576597
Artem TemosKeymasterHello,
Yes, we see the problem and noticed that your server blocks the
Elementor preview
request when the code is added https://gyazo.com/0ef74aaa718427da67e1403d5b4d4fb5
We don’t know exactly why it works this way but you need to consult with the hosting provider for help on this matter.Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register