Stop tracking via functions.php on a certain condition
-
Hey,
we recently switched to this Plugin, because some of the “Marketing” guys were unhappy with the results of the old Plugin. I can’t tell since I’m not much into all this Marketing stuff
But we gave the user the option to deny tracking by 3rd parties. I was doing that via this in our functions.php:
if(class_exists('WC_Google_Analytics_Integration')) { if(! allow_tracking()) remove_filter('woocommerce_integrations', array(WC_Google_Analytics_Integration::get_instance(), 'add_integration'), 10); }
We still want to give the user this option, I just don’t found out how to remove the action(s) where your plugin adds all the stuff. You’re using some kind of loop to add actions/filters, so I would love to ask is there a fast way to build a similar construct like above?
I look forward to hear from you!^^
Petschko
- The topic ‘Stop tracking via functions.php on a certain condition’ is closed to new replies.