Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions types/google-publisher-tag/google-publisher-tag-tests.ts
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down Expand Up @@ -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.
Expand Down
50 changes: 50 additions & 0 deletions types/google-publisher-tag/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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,
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion types/google-publisher-tag/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down