Skip to content

Commit 53c1613

Browse files
authored
Document targetingControls.lock (prebid#6223)
1 parent 502097b commit 53c1613

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

dev-docs/publisher-api-reference/setConfig.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,12 +703,14 @@ The `targetingControls` object passed to `pbjs.setConfig` provides some options
703703
{: .table .table-bordered .table-striped }
704704
| Attribute | Type | Description |
705705
|------------+---------+---------------------------------|
706-
| auctionKeyMaxChars | integer | Specifies the maximum number of characters the system can add to ad server targeting. |
707-
| alwaysIncludeDeals | boolean | If [enableSendAllBids](#setConfig-Send-All-Bids) is false, set this value to `true` to ensure that deals are sent along with the winning bid |
706+
| auctionKeyMaxChars | Integer | Specifies the maximum number of characters the system can add to ad server targeting. |
707+
| alwaysIncludeDeals | Boolean | If [enableSendAllBids](#setConfig-Send-All-Bids) is false, set this value to `true` to ensure that deals are sent along with the winning bid |
708708
| allowTargetingKeys | Array of Strings | Selects supported default targeting keys. |
709709
| addTargetingKeys | Array of Strings | Selects targeting keys to be supported in addition to the default ones |
710710
| allowSendAllBidsTargetingKeys | Array of Strings | Selects supported default targeting keys. |
711-
| allBidsCustomTargeting | boolean | Set to true to prevent custom targeting values from being set for non-winning bids |
711+
| allBidsCustomTargeting | Boolean | Set to true to prevent custom targeting values from being set for non-winning bids |
712+
| lock | Array of Strings | Targeting keys to lock |
713+
| lockTimeout | Integer | Lock timeout in milliseconds |
712714

713715
{: .alert.alert-info :}
714716
Note that this feature overlaps and can be used in conjunction with [sendBidsControl.bidLimit](#setConfig-Send-Bids-Control).
@@ -910,6 +912,27 @@ config.setConfig({
910912

911913
By default, non winning bids will have custom tageting values concatenated to the winning bid's custom targeting for the same key. The `allBidsCustomTargeting` setting is a boolean that, when set to `false`, prevents custom targeting values from being set for non-winning bids. This can be useful if you want to ensure that only the winning bid has custom targeting values set.
912914

915+
#### Details on the lock and lockTimeout settings
916+
{: .no_toc }
917+
918+
When `lock` is set, targeting set through `setTargetingForGPTAsync` or `setTargetingForAst`
919+
will prevent bids with the same targeting on any of the given keys from being used again until rendering is complete or
920+
`lockTimeout` milliseconds have passed.
921+
922+
For example, with the following:
923+
924+
```javascript
925+
pbjs.setConfig({
926+
targetingControls: {
927+
lock: ['hb_adid'],
928+
lockTimeout: 2000
929+
}
930+
});
931+
```
932+
933+
calling `pbjs.setTargetingForGPTAsync()` will "lock" the targeted `hb_adid` until its slot renders or 2 seconds have passed, preventing subsequent calls to `setTargetingForGPTAsync` from using bids with the same `hb_adid` in the meanwhile.
934+
If using standard targeting `hb_adid` is unique for each bid, so this would have the effect of preventing the same bid from being used for multiple slots at the same time.
935+
913936
<a name="setConfig-Configure-Responsive-Ads"></a>
914937

915938
### Configure Responsive Ads

0 commit comments

Comments
 (0)