From 2646f0618c332bcc9222bd73b8a055614f4448ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20Wytr=C4=99bowicz?= Date: Sun, 26 May 2024 21:40:57 +0200 Subject: [PATCH 1/2] Mention the WP Consent API integration in the README, list a few examples and usefull snippets. --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 5c85b316..f6d6a47f 100644 --- a/README.md +++ b/README.md @@ -83,3 +83,30 @@ add_filter( 'woocommerce_ga_gtag_consent_modes', function ( $consent_modes ) { ``` After the page loads, the consent for particular parameters can be updated by other plugins or custom code, implementing UI for customer-facing configuration using [Google's consent API](https://developers.google.com/tag-platform/security/guides/consent?hl=en&consentmode=advanced#update-consent) (`gtag('consent', 'update', {…})`). + +#### Cookie banners & WP Consent API + +The extension does not provide any UI, like a cookie banner, to let your visitors grant consent for tracking. However, it's integrated with [WP Consent API](https://wordpress.org/plugins/wp-consent-api/), so you can pick another extension that provides a banner that meets your needs. Like [Complianz](https://wordpress.org/plugins/complianz-gdpr/), [Cookiebot](https://wordpress.org/plugins/cookiebot), or [GDPR Cookie Compliance](https://wordpress.org/plugins/gdpr-cookie-compliance/). + +Each of those extensions may require additional setup or registration. Usually, the basic default setup works out of the box, but there may be some integration caveats. Here are a couple of the most frequent ones: + +##### GA4W overwrites the consent mode defaults set by the other extension + +If the additional extension you chose sets its own default state of consent modes, different than the one we set, and you would like to make sure we'll not overwrite that, you can use the `woocommerce_ga_gtag_consent_modes` snippet to change or disable our setup: + +```php +add_filter( 'woocommerce_ga_gtag_consent_modes', function ( $consent_modes ) { + return array(); +} ); +``` + +##### I want to stop firing the `page_view` event on the page load + +This is actually unrelated to the consent mode; it's a matter of the default tag config. You can alter it using the `woocommerce_ga_gtag_config` snippet + +```php +add_filter( 'woocommerce_ga_gtag_config', function ( $config ) { + $config['send_page_view'] = false; + return $config; +} ); +``` From 8cea445c7a93b47db48044c5698b86cbefbcbdcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20Wytr=C4=99bowicz?= Date: Mon, 3 Jun 2024 21:53:13 +0200 Subject: [PATCH 2/2] Remove CMP plugins examples, not to suggest we provide dedicated integration support. See pcTzPl-25o-p2#comment-3390 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f6d6a47f..87df69e5 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ After the page loads, the consent for particular parameters can be updated by ot #### Cookie banners & WP Consent API -The extension does not provide any UI, like a cookie banner, to let your visitors grant consent for tracking. However, it's integrated with [WP Consent API](https://wordpress.org/plugins/wp-consent-api/), so you can pick another extension that provides a banner that meets your needs. Like [Complianz](https://wordpress.org/plugins/complianz-gdpr/), [Cookiebot](https://wordpress.org/plugins/cookiebot), or [GDPR Cookie Compliance](https://wordpress.org/plugins/gdpr-cookie-compliance/). +The extension does not provide any UI, like a cookie banner, to let your visitors grant consent for tracking. However, it's integrated with [WP Consent API](https://wordpress.org/plugins/wp-consent-api/), so you can pick another extension that provides a banner that meets your needs. Each of those extensions may require additional setup or registration. Usually, the basic default setup works out of the box, but there may be some integration caveats. Here are a couple of the most frequent ones: