Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 tasks
jesus225 opened this issue Apr 17, 2021 · 2 comments
Closed
2 tasks

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

jesus225 opened this issue Apr 17, 2021 · 2 comments
Labels
type: enhancement The issue is a request for an enhancement.

Comments

@jesus225
Copy link

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 <script type='text/javascript'> and it causes purchase event to execute before main snippet is even loaded, missing the purchase event.

Could you please consider adding an additional filter for this purpose in your code (function get_ecommerce_tracking_code( $order_id ))?

Thank you in advance.
Regards.


  • Issue assigned to next milestone.
  • Issue assigned a priority (will be assessed by maintainers).
@jconroy jconroy added the type: enhancement The issue is a request for an enhancement. label Oct 28, 2021
@edirpedro
Copy link

This plugin has similar problems like in "Facebook for Woocommerce" when validating cookies law. I'd like to attach here the discussion from that other plugin because the same feature could be added in both plugins to enable developers to build a custom check on the client side instead of the server side that is not trustworthy when you are caching your website.

woocommerce/facebook-for-woocommerce#301 (comment)

@martynmjones
Copy link
Contributor

As part of the upcoming version 2.0.0 release, we have implemented Consent mode which addresses the GDPR requirements mentioned so I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

No branches or pull requests

4 participants