-
Notifications
You must be signed in to change notification settings - Fork 800
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
Tag the WooCommerce Analytics tracking script so that it can be disabled if visitors refuse cookies #13039
Comments
Related: #13039 For third-parties to be able to interact with our tracking script, it is easier if it is registered using core WP functions instead of just added to wp_head. Using wp_enqueue_script makes it easier to dequeue the file if needed, or modify its output with the script_loader_tag filter (one could add an async parameter for example, or add extra data attributes like the Cookiebot plugin.
I looked into this, and I believe this is something that needs to be implemented within the Cookiebot plugin directly, here: The Cookiebot plugin includes the However, for Cookiebot to be able to do that, we need to make a few changes to the way we add the file to sites in the first place. This will happen in #13173. Once that's merged, we can file an issue with the Cookiebot team to let them know about it. |
* Woo Analytics: use core WP function to enqueue script Related: #13039 For third-parties to be able to interact with our tracking script, it is easier if it is registered using core WP functions instead of just added to wp_head. Using wp_enqueue_script makes it easier to dequeue the file if needed, or modify its output with the script_loader_tag filter (one could add an async parameter for example, or add extra data attributes like the Cookiebot plugin. * Add utility allowing us to load some of our scripts asynchronously See #13173 (comment)
This issue has been marked as stale. This happened because:
No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation. |
Why does that script exist? And why is it contacting wp.com? Can it be disabled? |
@getsnoopy You can find out more about the feature and how it works in the Pull Request where it was introduced: #8296 It can be disabled if you are not interested in the feature. To do so, you can add the following snippet to a functionality plugin on your site: /**
* Never load Jetpack's WooCommerce Analytics tool.
*
* @param array $tools Array of additional tools loaded by Jetpack.
*/
function jetpackcom_no_woo_analytics( $tools ) {
$index = array_search( 'woocommerce-analytics/wp-woocommerce-analytics.php', $tools );
if ( false !== $index ) {
unset( $tools[ $index ] );
}
return $tools;
}
add_filter( 'jetpack_tools_to_include', 'jetpackcom_no_woo_analytics' ); |
Thanks. This feature should really be able to be disabled via the Jetpack modules page. It seems like there are many people on the web who have been trying to get rid of it to no avail |
@getsnoopy That's a good point, and definitely something worth considering. I'll add this to our to-do list for our next iteration on the feature. |
@getsnoopy In #15187, I have now made the feature a module that can disabled from this screen in your dashboard: You can consequently get rid of that code snippet above and disable the module when Jetpack 8.4 is released. |
@jeherve Quite the quick turnaround. Cheers! |
This issue has been marked as stale. This happened because:
No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation. |
Closing this now, since we've implemented #13173 to allow third-party plugins to customize that script. |
Is your feature request related to a problem? Please describe.
Jetpack WooCommerce Analytics script is not tagged to disable tracking if users refuse cookies, ie through Cookiebot's Cookie consent banner.
Describe the solution you'd like
Example, The line that says:
Needs to be modified so it will look like this:
Describe alternatives you've considered
Provide an option to refuse cookies and still use the site.
Additional context
Requested from 2165741-zen
The text was updated successfully, but these errors were encountered: