Open tyrann0us opened 6 years ago
@braekling, any chance to take a look at this? It currently prevents us from deploying GDPR compliant tracking opt out functionality on our customers websites. Thanks!
I'm currently working on a new update and will also have a look at your issue.
Steps to reproduce
Add tracking code:
toEnter manually
Current behavior
The modified tracking code is saved successfully into the database (reloading the options page shows the correct code) but the default, not modified code is rendered into the page (open website in incognito mode to verify).
Expected behavior
The modified tracking code should be rendered into the page.
Possible solution
get_site_option( 'wp-piwik-manually' )
(called here: https://github.com/braekling/WP-Matomo/blob/master/classes/WP_Piwik/TrackingCode.php#L17 if in Multisite environment and tracking method set to "manually") seems to return the default tracking code, whileself::$wpPiwik->getOption ( 'tracking_code' )
returns the correct one. It seems the terneryif
statement is wrong.Context (Environment)
WordPress v4.9.6 (based on Bedrock) WP-Piwik v1.0.19
Any feedback on this is highly appreciated! Especially in the light of the upcoming GDPR law which might force site owners to load the tracking code only if the user has opted in.