woocommerce / woocommerce-google-analytics-integration

WordPress plugin: Provides the integration between WooCommerce and Google Analytics.
http://wordpress.org/plugins/woocommerce-google-analytics-integration/
172 stars 69 forks source link

Missing filter for gtag snippet in case of purchase event #189

Closed jesus225 closed 8 months ago

jesus225 commented 3 years ago

What I expected

For the plugin to allow filtering snippet output on purchase events.

What happened instead

Available filters are not covering purchase events.

Steps to reproduce the issue

Hello!

I am currently using the filter "woocommerce_gtag_snippet" to modify main snippet output to remove text/javascript and change it for text/plain. This is to make it compatible with GDPR plugins which will only change it back to text/javascript and therefore actually execute the code after the user has consent.

I am using native woocomerce filter to do the same with the JQuery you inline in product pages.

This works well for most of the events except for purchase which is actually the most important. There is no filter in your code to modify the output so it always has the Githubissues.

  • Githubissues is a development platform for aggregating issues.