Removing Tag Manager Script
-
Hi,
I need to remove the Tag Manager code which is generated by this plugin. It’s generated like so:
<!-- Global site tag (gtag.js) - Google Ads: XX-XXXXXXXXX - Google for WooCommerce --> <script async src="https://www.googletagmanager.com/gtag/js?id=XX-XXXXXXXX"></script> <script>...</script> </head>
The reason I need to remove it is because we’ve already added the Tag manager code separately. The ID it uses is incorrect for the one we want to use for tracking in Tag Manager. The duplicate script added by the plugin is causing issues with our conversion tracking. Our other Tag Manager account is already setup to correctly track conversions but this script is causing it to break.
I thought I’d be able to remove it using the filter detailed here – https://github.com/woocommerce/google-listings-and-ads/blob/develop/src/Hooks/README.md#woocommerce_gla_disable_gtag_tracking – but this didn’t seem to change anything.
Instead I’ve had to manually comment out line 257 of the GlobalSiteTag class file. But obviously this isn’t a good solution as the change will be replaced when updating the plugin.
- You must be logged in to reply to this topic.