Merge pull request #23938 from steven-joyce/update-doubleclick-gpt-to-v179

Update doubleclick-gpt to v179
This commit is contained in:
Benjamin Lichtman
2018-02-28 13:37:34 -08:00
committed by GitHub
2 changed files with 21 additions and 5 deletions

View File

@@ -224,6 +224,8 @@ googletag.defineSlot("/1234567/news", [160, 600], "div-2").
googletag.display();
googletag.pubads().getSlots();
googletag.pubads().setTagForChildDirectedTreatment(1);
// Example with a single value for a key.
@@ -423,3 +425,13 @@ slot.setTargeting("allow_expandable", "true");
// Example with multiple values for a key inside in an array.
slot.setTargeting("interests", ["sports", "music", "movies"]);
// googletag.display accepts a div element as well as a div ID.
googletag.display(new HTMLElement());
// pubads.display accepts a div element.
googletag.pubads().display("/1234567/science", [300, 250], new HTMLElement());
// A named size can be a string or an array of strings.
googletag.pubads().display("/1234567/science/physics", [[300, 250], "fluid"], "div-1");
googletag.pubads().display("/1234567/science/physics", [[300, 250], ["fluid"]], "div-1");

View File

@@ -1,12 +1,13 @@
// Type definitions for Google Publisher Tag v104
// Type definitions for Google Publisher Tag v172
// Project: https://developers.google.com/doubleclick-gpt/reference
// Definitions by: John Wright <https://github.com/johngeorgewright>
// Steven Joyce <https://github.com/steven-joyce>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace googletag {
export type SingleSizeArray = number[];
export type NamedSize = string;
export type NamedSize = string | string[];
export type SingleSize = SingleSizeArray | NamedSize;
@@ -27,6 +28,7 @@ declare namespace googletag {
eventType: string,
listener: (event: events.ImpressionViewableEvent | events.SlotOnloadEvent | events.SlotRenderEndedEvent | events.slotVisibilityChangedEvent) => void
): void;
getSlots(): Slot[];
}
export interface CompanionAdsService extends Service {
@@ -42,7 +44,6 @@ declare namespace googletag {
advertiserId: string;
campaignId: string;
creativeId?: number;
labelIds: number[];
lineItemId?: number;
}
@@ -61,7 +62,7 @@ declare namespace googletag {
defineSlot(adUnitPath: string, size: GeneralSize, opt_div?: string): Slot;
destroySlots(opt_slots?: Slot[]): boolean;
disablePublisherConsole(): void;
display(div?: string): void;
display(div?: string | Element): void;
enableServices(): void;
getVersion(): string;
openConsole(opt_div?: string): void;
@@ -113,7 +114,7 @@ declare namespace googletag {
defineOutOfPagePassback(adUnitPath: string): PassbackSlot;
definePassback(adUnitPath: string, size: GeneralSize): PassbackSlot;
disableInitialLoad(): void;
display(adUnitPath: string, size: GeneralSize, opt_div?: string, opt_clickUrl?: string): Slot;
display(adUnitPath: string, size: GeneralSize, opt_div?: string | Element, opt_clickUrl?: string): Slot;
enableAsyncRendering(): boolean;
enableSingleRequest(): boolean;
enableSyncRendering(): boolean;
@@ -154,12 +155,15 @@ declare namespace googletag {
}
export interface SlotRenderEndedEvent {
advertiserId?: number;
creativeId?: number;
isEmpty: boolean;
lineItemId?: number;
serviceName: string;
size: number[] | string;
slot: Slot;
sourceAgnosticCreativeId?: number;
sourceAgnosticLineItemId?: number;
}
export interface slotVisibilityChangedEvent {