Hi @nabaraj-chapagain,
Thanks for using our plugins.
Could you please provide more details about the issue?
What is the script you are using on your website (you can replace the ID’s with custom XYZ strings)?
What is your website URL where we can check the issue?
You can check our related topics as well:
https://ww.wp.xz.cn/support/topic/white-screen-during-navigation/
https://support.mooveagency.com/topic/website-re-loads-after-a-few-seconds-once/
Hope this helps.
Hello
Thanks for the reply. Below is the GTM code
<!– Google Tag Manager –>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({‘gtm.start’:
new Date().getTime(),event:’gtm.js’});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!=’dataLayer’?’&l=’+l:”;j.async=true;j.src=
‘https://www.googletagmanager.com/gtm.js?id=’+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,’script’,’dataLayer’,’GTM-xxxxxxx’);</script>
<!– End Google Tag Manager –>
I’ve put this inside the third party cookie section. We’re trying to track some form submissions and button clicks.
The GTM preview mode wont work. The code that is dynamically injected wont record any conversions.
We cant directly add to code to header because of the cookie added by the GTM. And trying to make it GDPR compliance wont track anything after moved from header to the plugin header section.
Any solution for this?
Can you provide some updates please?
Hi @nabaraj-chapagain,
Please replace your GTM script with the following snippet, and place to the correct position (peplace the GTM-ZZZZZZ to your real ID):
Third Party – Header Scripts
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-ZZZZZZ');</script>
<!-- End Google Tag Manager -->
Third Party – Body Scripts
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-ZZZZZZ"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
Also, please ensure the https://www.example.com/wp-admin/admin-ajax.php is not protected, so if you open in a browser, you should see a 0. Sometimes the wp-admin area is protected but the admin-ajax.php is not whitelisted and this causes the issue. If it’s protected and you can’t whitelist the AJAX in your website, you can add the following code snippet to your functions.php
add_action( 'gdpr_cc_prevent_ajax_script_inject', '__return_true' );
If none of the solutions listed above is working, please share your site URL in order to see the errors and start the investigation for you.
Thanks