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
21 changes: 20 additions & 1 deletion 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.20260309
// Synced from: https://github.com/googleads/google-publisher-tag-types/commit/27374b01c38e0f8a66fe8181574edee6d5570200
// Synced from: https://github.com/googleads/google-publisher-tag-types/commit/b016c4944f367bc81fd32a072d0648154987849d

// Test for googletag.cmd
function test_googletag_cmd() {
Expand Down Expand Up @@ -666,6 +666,16 @@ function test_googletag_config_adExpansionConfig() {
});
}

// Test for googletag.config.AutoRefreshConfig.heavyAds
function test_googletag_config_autoRefreshConfig_heavyAds() {
// Set the auto refresh configuration, disabling auto refresh on heavy
// ad intervention.
googletag.setConfig({ autoRefresh: { heavyAds: false } });

// Clear the auto refresh configuration, restoring to default behavior.
googletag.setConfig({ autoRefresh: null });
}

// Test for googletag.config.PageSettingsConfig.threadYield
function test_googletag_config_pageSettingsConfig_threadYield() {
// Disable yielding.
Expand Down Expand Up @@ -816,6 +826,15 @@ function test_googletag_config_pageSettingsConfig_adsenseAttributes() {
googletag.setConfig({ adsenseAttributes: null });
}

// Test for googletag.config.PageSettingsConfig.autoRefresh
function test_googletag_config_pageSettingsConfig_autoRefresh() {
// Set the auto refresh configuration.
googletag.setConfig({ autoRefresh: { heavyAds: false } });

// Clear the auto refresh configuration.
googletag.setConfig({ autoRefresh: null });
}

// Test for googletag.config.PrivacyTreatmentsConfig.treatments
function test_googletag_config_privacyTreatmentsConfig_treatments() {
// Disable personalization across the entire page.
Expand Down
33 changes: 33 additions & 0 deletions types/google-publisher-tag/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1864,6 +1864,27 @@ declare namespace googletag {
adsense_test_mode?: "on" | null;
}

/**
* Auto refresh configuration settings.
*/
interface AutoRefreshConfig {
/**
* Whether GPT will automatically refresh an ad slot if Chrome's Heavy Ad
* Intervention triggers on the slot's ad iframe. Defaults to `true`.
*
* @example
* // Set the auto refresh configuration, disabling auto refresh on heavy
* // ad intervention.
* googletag.setConfig({autoRefresh: {heavyAds: false}});
*
* // Clear the auto refresh configuration, restoring to default behavior.
* googletag.setConfig({autoRefresh: null});
*
* @see [Understand Chrome's Heavy Ad Interventions](https://developer.chrome.com/docs/web-platform/heavy-ads-intervention)
*/
heavyAds?: boolean;
}

/**
* Settings to control the use of lazy loading in GPT.
*
Expand Down Expand Up @@ -2279,6 +2300,18 @@ declare namespace googletag {
* googletag.setConfig({adsenseAttributes: null});
*/
adsenseAttributes?: AdSenseAttributesConfig | null;

/**
* Setting to configure automatic ad refresh behavior.
*
* @example
* // Set the auto refresh configuration.
* googletag.setConfig({autoRefresh: {heavyAds: false}});
*
* // Clear the auto refresh configuration.
* googletag.setConfig({autoRefresh: null});
*/
autoRefresh?: AutoRefreshConfig | null;
}

/**
Expand Down