Skip to content

Commit e58f789

Browse files
authored
WordAds: Add option to toggle CMP banner under Monetize settings (#35205)
* changelog * add support text w/ link to gdpr toggle * RAN tools/fixup-project-versions.sh
1 parent f001223 commit e58f789

27 files changed

+107
-20
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: added
3+
4+
Ads Settings: Include option to toggle GDPR Consent Banner

projects/packages/sync/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"link-template": "https://github.com/Automattic/jetpack-sync/compare/v${old}...v${new}"
5959
},
6060
"branch-alias": {
61-
"dev-trunk": "2.7.x-dev"
61+
"dev-trunk": "2.8.x-dev"
6262
}
6363
},
6464
"config": {

projects/packages/sync/src/class-defaults.php

+1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ class Defaults {
167167
'videopress_private_enabled_for_site',
168168
'wordads_ccpa_enabled',
169169
'wordads_ccpa_privacy_policy_url',
170+
'wordads_cmp_enabled',
170171
'wordads_custom_adstxt',
171172
'wordads_custom_adstxt_enabled',
172173
'wordads_display_archive',

projects/packages/sync/src/class-package-version.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class Package_Version {
1414

15-
const PACKAGE_VERSION = '2.7.0';
15+
const PACKAGE_VERSION = '2.8.0-alpha';
1616

1717
const PACKAGE_SLUG = 'sync';
1818

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: changed
3+
Comment: Updated composer.lock.
4+
5+

projects/plugins/backup/composer.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: changed
3+
Comment: Updated composer.lock.
4+
5+

projects/plugins/boost/composer.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

projects/plugins/jetpack/_inc/client/earn/ads.jsx

+24
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ export const Ads = withModuleSettingsFormHelpers(
139139
'wordads_ccpa_privacy_policy_url',
140140
'wordads'
141141
);
142+
143+
const wordads_cmp_enabled = this.props.getOptionValue( 'wordads_cmp_enabled', 'wordads' );
144+
142145
const isSubDirSite = this.props.siteRawUrl.indexOf( '::' ) !== -1;
143146
return (
144147
<SettingsCard
@@ -355,6 +358,27 @@ export const Ads = withModuleSettingsFormHelpers(
355358
</FormFieldset>
356359
) }
357360
</SettingsGroup>
361+
<SettingsGroup
362+
support={ {
363+
text: __(
364+
'Show a cookie banner to all EU and UK site visitors prompting them to consent to their personal data being used to personalize the ads they see. Without proper consents EU/UK visitors will only see lower paying non-personalized ads.',
365+
'jetpack'
366+
),
367+
link: getRedirectUrl( 'jetpack-support-ads' ),
368+
} }
369+
>
370+
<ToggleControl
371+
checked={ wordads_cmp_enabled }
372+
disabled={
373+
! isAdsActive ||
374+
unavailableInOfflineMode ||
375+
this.props.isSavingAnyOption( [ 'wordads' ] )
376+
}
377+
toggling={ this.props.isSavingAnyOption( [ 'wordads_cmp_enabled' ] ) }
378+
onChange={ this.handleChange( 'wordads_cmp_enabled' ) }
379+
label={ __( 'Enable GDPR Consent Banner', 'jetpack' ) }
380+
/>
381+
</SettingsGroup>
358382
{ ! isSubDirSite && this.renderAdsTxtSection() }
359383
{ ! unavailableInOfflineMode && isAdsActive && (
360384
<Card

projects/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php

+7
Original file line numberDiff line numberDiff line change
@@ -2841,6 +2841,13 @@ public static function get_updateable_data_list( $selector = '' ) {
28412841
'sanitize_callback' => 'sanitize_text_field',
28422842
'jp_group' => 'wordads',
28432843
),
2844+
'wordads_cmp_enabled' => array(
2845+
'description' => esc_html__( 'Enable GDPR Consent Management Banner for WordAds', 'jetpack' ),
2846+
'type' => 'boolean',
2847+
'default' => 0,
2848+
'validate_callback' => __CLASS__ . '::validate_boolean',
2849+
'jp_group' => 'wordads',
2850+
),
28442851

28452852
// Google Analytics.
28462853
'google_analytics_tracking_id' => array(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: enhancement
3+
4+
Ads Settings: Include option to toggle GDPR Consent Banner
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: other
3+
Comment: Updated composer.lock.
4+
5+

projects/plugins/jetpack/composer.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

projects/plugins/jetpack/modules/wordads/php/class-wordads-params.php

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public function __construct() {
9393
'wordads_custom_adstxt_enabled' => false,
9494
'wordads_ccpa_enabled' => false,
9595
'wordads_ccpa_privacy_policy_url' => get_option( 'wp_page_for_privacy_policy' ) ? get_permalink( (int) get_option( 'wp_page_for_privacy_policy' ) ) : '',
96+
'wordads_cmp_enabled' => false,
9697
);
9798

9899
// Grab settings, or set as default if it doesn't exist.

projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-options.php

+1
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ public function test_sync_default_options() {
211211
'wordads_custom_adstxt_enabled' => false,
212212
'wordads_ccpa_enabled' => false,
213213
'wordads_ccpa_privacy_policy_url' => 'pineapple',
214+
'wordads_cmp_enabled' => false,
214215
'woocommerce_custom_orders_table_enabled' => false,
215216
'site_user_type' => wp_json_encode( array( 1 => 'pineapple' ) ),
216217
'site_segment' => 'pineapple',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: changed
3+
Comment: Updated composer.lock.
4+
5+

projects/plugins/migration/composer.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: changed
3+
Comment: Updated composer.lock.
4+
5+

projects/plugins/protect/composer.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: changed
3+
Comment: Updated composer.lock.
4+
5+

projects/plugins/search/composer.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: changed
3+
Comment: Updated composer.lock.
4+
5+

projects/plugins/social/composer.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: changed
3+
Comment: Updated composer.lock.
4+
5+

projects/plugins/starter-plugin/composer.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: changed
3+
Comment: Updated composer.lock.
4+
5+

projects/plugins/videopress/composer.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)