When the user is not opted into WooCommerce tracking we should avoid tracking the data for the extension. However, right now we are not doing that and we track the data without checking if the user is opted-in. This PR fixes that.
Checks:
[x] Does your code follow the WordPress coding standards?
[ ] Have you written new tests for your changes, as applicable?
[x] Have you successfully run tests with your changes locally?
[x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
Screenshots:
Detailed test instructions:
Checkout this PR
Run wp option update woocommerce_allow_tracking "no" in WP CLI or set woocommerce_allow_tracking option as "no"
Run wp wc tracker snapshot --format=yaml in WPCLI
See the wc-google-analytics not appearing in the tracking
Run wp option update woocommerce_allow_tracking "yes" in WP CLI or set woocommerce_allow_tracking option as "yes"
Run wp wc tracker snapshot --format=yaml in WPCLI
. See the wc-google-analytics appearing in the tracking
Additional details:
Changelog entry
Fix - Avoid tracking data when user is not opted-in
Changes proposed in this Pull Request:
When the user is not opted into WooCommerce tracking we should avoid tracking the data for the extension. However, right now we are not doing that and we track the data without checking if the user is opted-in. This PR fixes that.
Checks:
Screenshots:
Detailed test instructions:
wp option update woocommerce_allow_tracking "no"
in WP CLI or setwoocommerce_allow_tracking
option as "no"wp wc tracker snapshot --format=yaml
in WPCLIwc-google-analytics
not appearing in the trackingwp option update woocommerce_allow_tracking "yes"
in WP CLI or setwoocommerce_allow_tracking
option as "yes"wp wc tracker snapshot --format=yaml
in WPCLIwc-google-analytics
appearing in the trackingAdditional details:
Changelog entry