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
10 changes: 7 additions & 3 deletions _includes/video/pb-os-dfp.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,14 @@
if (pbjs.initAdserverSet) return;
pbjs.initAdserverSet = true;
googletag.cmd.push(function () {
pbjs.que.push(function () {
pbjs.setTargetingForGPTAsync();
if (pbjs.libLoaded) {
pbjs.que.push(function () {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
} else {
googletag.pubads().refresh();
});
}
});
}

Expand Down
10 changes: 8 additions & 2 deletions dev-docs/examples/basic-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,14 @@ function initAdserver() {
if (pbjs.initAdserverSet) return;
pbjs.initAdserverSet = true;
googletag.cmd.push(function() {
pbjs.setTargetingForGPTAsync && pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
if (pbjs.libLoaded) {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
} else {
googletag.pubads().refresh();
}
});
}

Expand Down
10 changes: 7 additions & 3 deletions dev-docs/examples/custom-price-buckets.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,14 @@ function initAdserver() {
if (pbjs.initAdserverSet) return;
pbjs.initAdserverSet = true;
googletag.cmd.push(function() {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
if (pbjs.libLoaded) {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
} else {
googletag.pubads().refresh();
});
}
});
}

Expand Down
10 changes: 7 additions & 3 deletions dev-docs/examples/instream-banner-mix.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,14 @@ function initAdserver(bids) {

// Set targeting for each display slot
googletag.cmd.push(function() {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync(displayAdUnitCodes);
if (pbjs.libLoaded) {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync(displayAdUnitCodes);
googletag.pubads().refresh();
});
} else {
googletag.pubads().refresh();
});
}
});

// Build DFP URL with targeting for videoAdUnit
Expand Down
10 changes: 8 additions & 2 deletions dev-docs/examples/meta-bid-filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,14 @@ function initAdserver() {
if (pbjs.initAdserverSet) return;
pbjs.initAdserverSet = true;
googletag.cmd.push(function() {
pbjs.setTargetingForGPTAsync && pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
if (pbjs.libLoaded) {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
} else {
googletag.pubads().refresh();
}
});
}

Expand Down
10 changes: 7 additions & 3 deletions dev-docs/examples/native-ad-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,14 @@ function initAdserver() {
if (pbjs.initAdserverSet) return;

googletag.cmd.push(function() {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
if (pbjs.libLoaded) {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
} else {
googletag.pubads().refresh();
});
}
});

pbjs.initAdserverSet = true;
Expand Down
10 changes: 7 additions & 3 deletions dev-docs/examples/size-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,14 @@ function sendAdserverRequest() {
if (pbjs.adserverRequestSent) return;
pbjs.adserverRequestSent = true;
googletag.cmd.push(function() {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
if (pbjs.libLoaded) {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
} else {
googletag.pubads().refresh();
});
}
});
}

Expand Down
13 changes: 10 additions & 3 deletions dev-docs/examples/sync-tid.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,16 @@ pbjs.que.push(function() {
function prebidBidsBack() {
pbjs.initAdserverSet = true;
googletag.cmd.push(function() {
pbjs.setTargetingForGPTAsync && pbjs.setTargetingForGPTAsync();
requestManager.prebid = true;
sendBidsToAdServer();
if (pbjs.libLoaded) {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
requestManager.prebid = true;
sendBidsToAdServer();
});
} else {
googletag.pubads().refresh();
requestManager.adserverRequestSent = true;
}
});
}

Expand Down
10 changes: 8 additions & 2 deletions docs-examples/web-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,14 @@ function initAdserver() {
if (pbjs.initAdserverSet) return;
pbjs.initAdserverSet = true;
googletag.cmd.push(function() {
pbjs.setTargetingForGPTAsync && pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
if (pbjs.libLoaded) {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
} else {
googletag.pubads().refresh();
}
});
}

Expand Down
10 changes: 7 additions & 3 deletions examples/video/outstream/pb-ve-outstream-dfp.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,14 @@ <h4>Place this code in the page header.</h4>
if (pbjs.initAdserverSet) return;
pbjs.initAdserverSet = true;
googletag.cmd.push(function() {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
if (pbjs.libLoaded) {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
} else {
googletag.pubads().refresh();
});
}
});
}

Expand Down