Skip to content

Commit

Permalink
Merge pull request #783 from PubMatic-OpenWrap/UOE-9822
Browse files Browse the repository at this point in the history
UOE-9822 : Updated default keys for Auto Refresh
  • Loading branch information
kapil-tuptewar authored Dec 11, 2023
2 parents eb7cde3 + f7830a6 commit 56b55e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions modules/pubmaticAutoRefresh.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ let openWrapSetup = {
Object.keys(KeyValuePairs).forEach(key => gptSlot.setTargeting(key, KeyValuePairs[key]));

let adServerInitiated = false;
let PWT = window.PWT || {};

let sendAdserverRequest = function() {
if (adServerInitiated === true) {
Expand Down Expand Up @@ -133,11 +134,11 @@ let DEFAULT_CONFIG = {
// set it to 0 to refresh all gptSlots w/o visibility percentage check
refreshAdSlotWithMinimumViewabilityPercentage: 50,
// this key will be added on gptSlot with kvValueForRefresh value; set it to null to not set it
kvKeyForRefresh: 'pm-auto-refresh',
kvKeyForRefresh: 'pm-refresh',
// this value will be added for the key kvKeyForRefresh on the gptSlot
kvValueForRefresh: '1',
// this key will be added on the gptSlot and its value will be the refresh count; set it to null to not set it
kvKeyForRefreshCount: 'pm-auto-refresh-count',
kvKeyForRefreshCount: 'pm-refresh-count',
// a function; the default callback function
callbackFunction: isOpenWrapSetup ? openWrapSetup.callbackFunction : pbjsSetup.callbackFunction,
// a function; if you are using customConfig for some gptSlots then we need a way to find name of the gptSlot in customConfig
Expand Down
4 changes: 2 additions & 2 deletions modules/pubmaticAutoRefresh.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
| countdownDuration | int | 30000 | time in milliseconds|
| startCountdownWithMinimumViewabilityPercentage | int (0-100) | 50 | the countDown will start when ad-slot will have viewability percenatge more than this. When set to 0 the count-down will start after rendering the creative, even when ad slot is not viewable. |
| refreshAdSlotWithMinimumViewabilityPercentage | int (0-100) | 50 | the ad slot will be refreshed only if it has viewability percenathge more than this value. When set to 0 the ad-slot will be refreshed even if it is not viewable|
| kvKeyForRefresh | string | 'pm-auto-refresh' | this key will be added on gptSlot with kvValueForRefresh value; set it to null to not set it |
| kvKeyForRefresh | string | 'pm-refresh' | this key will be added on gptSlot with kvValueForRefresh value; set it to null to not set it. This key had default value of 'pm-auto-refresh' before v27.5.0 |
| kvValueForRefresh | string | '1' | this value will be added for the key kvKeyForRefresh on the gptSlot |
| kvKeyForRefreshCount | string | 'pm-auto-refresh-count' | this key will be added on the gptSlot and its value will be the refresh count; set it to null to not set it |
| kvKeyForRefreshCount | string | 'pm-refresh-count' | this key will be added on the gptSlot and its value will be the refresh count; set it to null to not set it. This key had default value of 'pm-auto-refresh-count' before v27.5.0|
| slotIdFunctionForCustomConfig | function | `(gpttSlot) => gptSlot.getSlotElementId()` | a function; if you are using customConfig for some gptSlots then we need a way to find name of the gptSlot in customConfig |
| callbackFunction | function | `(gptSlotName, gptSlot, pbjsAdUnit, KeyValuePairs) => { performs pbjs auction, sets kvs, refreshes GPT slot}` | the default callback function, if you set own callback function then you will need to take care of initiating Prebid auction, setting KVs and refresing GPT slot |
| gptSlotToPbjsAdUnitMapFunction | function | `(gptSlot) => (gptSlot.getAdUnitPath() === pbjsAU.code || gptSlot.getSlotElementId() === pbjsAU.code)` | this function will help find the GPT gptSlots matching PBJS AdUnit |
Expand Down

0 comments on commit 56b55e1

Please sign in to comment.