diff --git a/types/google-publisher-tag/google-publisher-tag-tests.ts b/types/google-publisher-tag/google-publisher-tag-tests.ts index 4817f40fce84a7..0b7021e8b879eb 100644 --- a/types/google-publisher-tag/google-publisher-tag-tests.ts +++ b/types/google-publisher-tag/google-publisher-tag-tests.ts @@ -1,5 +1,5 @@ -// Tests for Google Publisher Tag 1.20260413 -// Synced from: https://github.com/googleads/google-publisher-tag-types/commit/a7102d4da14f534c852664c73adb77db8b803545 +// Tests for Google Publisher Tag 1.20260420 +// Synced from: https://github.com/googleads/google-publisher-tag-types/commit/fec849a853dfba65b7059ba9c2f6a30bbcfa4add // Test for googletag.cmd function test_googletag_cmd() { @@ -123,6 +123,19 @@ function test_googletag_privacySettingsConfig_trafficSource() { }); } +// Test for googletag.PrivacySettingsConfig.tagForAgeTreatment +function test_googletag_privacySettingsConfig_tagForAgeTreatment() { + // Enable teen privacy treatment. + googletag.pubads().setPrivacySettings({ + tagForAgeTreatment: googletag.enums.TagForAgeTreatment.TEEN, + }); + + // Clear age treatment configuration. + googletag.pubads().setPrivacySettings({ + tagForAgeTreatment: googletag.enums.TagForAgeTreatment.UNSPECIFIED, + }); +} + // Test for googletag.PubAdsService.setTargeting function test_googletag_pubAdsService_setTargeting() { // Example with a single value for a key. diff --git a/types/google-publisher-tag/index.d.ts b/types/google-publisher-tag/index.d.ts index 4a40d259e7b952..0b93356851c994 100644 --- a/types/google-publisher-tag/index.d.ts +++ b/types/google-publisher-tag/index.d.ts @@ -442,6 +442,33 @@ declare namespace googletag { * }); */ trafficSource?: enums.TrafficSource; + + /** + * The age-restricted treatment, indicating whether the ad request should be + * treated as child, teen, or unspecified. + * + * Consult your own legal counsel to determine the age treatment settings for + * your users based on your legal and regulatory requirements. For more + * information on this setting, review this [Help Center article]( + * https://support.google.com/adsense/answer/9007197). + * + * By setting this property, you certify that this notification is accurate + * and you are authorized to act on behalf of the owner of the site. You + * understand that abuse of this setting may result in termination of your + * Google account. + * + * @example + * // Enable teen privacy treatment. + * googletag.pubads().setPrivacySettings({ + * tagForAgeTreatment: googletag.enums.TagForAgeTreatment.TEEN + * }); + * + * // Clear age treatment configuration. + * googletag.pubads().setPrivacySettings({ + * tagForAgeTreatment: googletag.enums.TagForAgeTreatment.UNSPECIFIED + * }); + */ + tagForAgeTreatment?: enums.TagForAgeTreatment; } /** @@ -2859,6 +2886,29 @@ declare namespace googletag { /** Direct URL entry, site search, or app download. */ ORGANIC, } + + /** + * Age treatment settings supported by GPT. + * + * @see {@link PrivacySettingsConfig.tagForAgeTreatment} + */ + enum TagForAgeTreatment { + /** + * Default value. Indicates that no specific age restricted treatment signal + * applies to the ad request. + */ + UNSPECIFIED, + + /** + * Indicates that ad requests should receive CHILD age treatment. + */ + CHILD, + + /** + * Indicates that ad requests should receive TEEN age treatment. + */ + TEEN, + } } /** diff --git a/types/google-publisher-tag/package.json b/types/google-publisher-tag/package.json index 83dead47adfdfc..635bbea05c307d 100644 --- a/types/google-publisher-tag/package.json +++ b/types/google-publisher-tag/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/google-publisher-tag", - "version": "1.20260413.9999", + "version": "1.20260420.9999", "nonNpm": "conflict", "nonNpmDescription": "Google Publisher Tag", "projects": [