Skip to content

Commit

Permalink
Remove references to hb_ttr targeting value (#166)
Browse files Browse the repository at this point in the history
Suspect that this hasn't been used since introduction in 2018 (#4)
The only place it was used in the code was when setting the value to -1 when bids time out, though may have been used in other places in the past to indicate time for an auction to run.

Additionally the Guardian modifications file has been updated to note that we currently split the bundle by region and so need to run `npm run gu-build` rather than `npm run build`
  • Loading branch information
cemms1 authored Jan 22, 2025
1 parent ce0b86b commit ac7a815
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 87 deletions.
9 changes: 2 additions & 7 deletions GUARDIAN_modifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ Building `build/dist/prebid.js` is achieved by running the following `gulp` comm
gulp build
```

- Ad server targeting includes a `hb_ttr` parameter, whose value will be one of:
- the time to respond for the winning bid in ms (ie. time between bid request sent and bid response received)
- -1 if the auction timed out without a winning bid and still waiting for at least one bid response
- otherwise not passed at all

## Bid adapters

- The [Sonobi adapter](/modules/sonobiBidAdapter.js):
Expand Down Expand Up @@ -65,8 +60,8 @@ gulp build
1. Ensure the package.json name field is `@guardian/prebid.js`
1. If this upgrade diverges from the upstream prebid.js version (i.e. a Guardian specific change) add a suffix to the package.json version field e.g. 8.34.0-1
1. Create new build
> npm run build
1. Commit and ensure `build/dist/prebid.js` is included
> npm run gu-build
1. Commit and ensure `build/dist/all/prebid.js` is included

### Troubleshooting

Expand Down
30 changes: 15 additions & 15 deletions build/dist/all/prebid.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions build/dist/aus-nz/prebid.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions build/dist/row/prebid.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions build/dist/uk/prebid.js

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions build/dist/us/prebid.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@guardian/prebid.js",
"version": "8.52.0-10",
"version": "8.52.0-11",
"description": "Header Bidding Management Library",
"main": "src/prebid.js",
"files": [
Expand Down
14 changes: 0 additions & 14 deletions src/targeting.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,6 @@ export function newTargeting(auctionManager) {
}
};

/* gu-mod-start */
function addTimedOutIncompleteAuction(adUnitCode, targeting) {
return targeting.push({[adUnitCode]: [{hb_ttr: [-1]}]});
}
/* gu-mod-end */

targeting.resetPresetTargetingAST = function(adUnitCode) {
const adUnitCodes = getAdUnitCodes(adUnitCode);
adUnitCodes.forEach(function(unit) {
Expand Down Expand Up @@ -291,14 +285,6 @@ export function newTargeting(auctionManager) {
});
});

/* gu-mod-start */
const winningBid = winningBidTargeting.length > 0;
const someBidTimedOut = auctionManager.getBidsRequested().some((bidRequest) => bidRequest.doneCbCallCount === 0);
if (!winningBid && someBidTimedOut) {
addTimedOutIncompleteAuction(adUnitCodes[0], targeting);
}
/* gu-mod-end */

const defaultKeys = Object.keys(Object.assign({}, DEFAULT_TARGETING_KEYS, NATIVE_KEYS));
let allowedKeys = config.getConfig(CFG_ALLOW_TARGETING_KEYS);
const addedKeys = config.getConfig(CFG_ADD_TARGETING_KEYS);
Expand Down
3 changes: 0 additions & 3 deletions test/fixtures/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ const utils = require('src/utils.js');

function convertTargetingsFromOldToNew(targetings) {
var mapOfOldToNew = {
/* gu-mod-start */
'hb_ttr': TARGETING_KEYS.TIME_TO_RESPOND,
/* gu-mod-end */
'hb_bidder': TARGETING_KEYS.BIDDER,
'hb_adid': TARGETING_KEYS.AD_ID,
'hb_pb': TARGETING_KEYS.PRICE_BUCKET,
Expand Down

0 comments on commit ac7a815

Please sign in to comment.