mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-13 12:37:16 +08:00
Merge pull request #28413 from overflew/master
doubleclick-gpt: Update to v238 - Add enableLazyLoad & setTagForUnderAgeOfConsent
This commit is contained in:
@@ -69,6 +69,10 @@ googletag.pubads().definePassback("/1234567/sports", [468, 60])
|
||||
.setTagForChildDirectedTreatment(1)
|
||||
.display();
|
||||
|
||||
googletag.pubads().definePassback('/1234567/sports', [468, 60])
|
||||
.setTagForUnderAgeOfConsent(1)
|
||||
.display();
|
||||
|
||||
googletag.pubads().definePassback("/1234567/sports", [468, 60]).
|
||||
setTargeting("color", "red").
|
||||
setTargeting("sport", ["rugby", "rowing"]).
|
||||
@@ -79,6 +83,13 @@ googletag.pubads().definePassback("/1234567/sports", [160, 600]).
|
||||
"interests": ["sports", "music", "movies"]}).
|
||||
display();
|
||||
|
||||
googletag.pubads().enableLazyLoad();
|
||||
googletag.pubads().enableLazyLoad({
|
||||
fetchMarginPercent: 500,
|
||||
renderMarginPercent: 200,
|
||||
mobileScaling: 2.0
|
||||
});
|
||||
|
||||
// The calls to construct an ad and display contents.
|
||||
slot1 = googletag.pubads().display("/1234567/sports", [728, 90], "div-1");
|
||||
slot2 = googletag.pubads().display("/1234567/news", [160, 600], "div-2");
|
||||
@@ -107,6 +118,13 @@ googletag.pubads().setTagForChildDirectedTreatment(1);
|
||||
// Clear child-directed setting and return to initial not-set value.
|
||||
googletag.pubads().clearTagForChildDirectedTreatment();
|
||||
|
||||
// Mark ad requests as coming from users under the age of consent.
|
||||
googletag.pubads().setTagForUnderAgeOfConsent(1);
|
||||
|
||||
// Clear the tag value that configures whether to mark ad requests as
|
||||
// coming from users under the age of consent.
|
||||
googletag.pubads().setTagForUnderAgeOfConsent();
|
||||
|
||||
googletag.pubads().setTargeting("interests", "sports");
|
||||
googletag.pubads().setTargeting("colors", "blue");
|
||||
googletag.pubads().setTargeting("fruits", "apple");
|
||||
|
||||
11
types/doubleclick-gpt/index.d.ts
vendored
11
types/doubleclick-gpt/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Google Publisher Tag v199
|
||||
// Type definitions for Google Publisher Tag v238
|
||||
// Project: https://developers.google.com/doubleclick-gpt/reference
|
||||
// Definitions by: John Wright <https://github.com/johngeorgewright>
|
||||
// Steven Joyce <https://github.com/steven-joyce>
|
||||
@@ -40,6 +40,12 @@ declare namespace googletag {
|
||||
setContent(slot: Slot, content: String): void;
|
||||
}
|
||||
|
||||
export interface LazyLoadOptionsConfig {
|
||||
fetchMarginPercent?: number,
|
||||
renderMarginPercent?: number,
|
||||
mobileScaling?: number
|
||||
}
|
||||
|
||||
export interface ResponseInformation {
|
||||
advertiserId: string;
|
||||
campaignId: string;
|
||||
@@ -101,6 +107,7 @@ declare namespace googletag {
|
||||
setClickUrl(url: string): PassbackSlot;
|
||||
setForceSafeFrame(forceSafeFrame: boolean): PassbackSlot;
|
||||
setTagForChildDirectedTreatment(value: number): PassbackSlot;
|
||||
setTagForUnderAgeOfConsent(value: number): PassbackSlot;
|
||||
setTargeting(key: string, value: string | string[]): PassbackSlot;
|
||||
updateTargetingFromMap(map: Object): PassbackSlot;
|
||||
}
|
||||
@@ -116,6 +123,7 @@ declare namespace googletag {
|
||||
disableInitialLoad(): void;
|
||||
display(adUnitPath: string, size: GeneralSize, opt_div?: string | Element, opt_clickUrl?: string): Slot;
|
||||
enableAsyncRendering(): boolean;
|
||||
enableLazyLoad(opt_config?: LazyLoadOptionsConfig): void;
|
||||
enableSingleRequest(): boolean;
|
||||
enableSyncRendering(): boolean;
|
||||
enableVideoAds(): void;
|
||||
@@ -134,6 +142,7 @@ declare namespace googletag {
|
||||
setRequestNonPersonalizedAds(nonPersonalizedAds: 0 | 1): PubAdsService;
|
||||
setSafeFrameConfig(config: SafeFrameConfig): PubAdsService;
|
||||
setTagForChildDirectedTreatment(value: number): PubAdsService;
|
||||
setTagForUnderAgeOfConsent(opt_value?: number): PubAdsService;
|
||||
setTargeting(key: string, value: string | string[]): PubAdsService;
|
||||
setVideoContent(videoContentId: string, videoCmsId: string): void;
|
||||
updateCorrelator(): PubAdsService;
|
||||
|
||||
Reference in New Issue
Block a user