Skip to content

Commit fea71ed

Browse files
committed
Docs for page view ID-related changes.
1 parent 33bba64 commit fea71ed

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

dev-docs/bidder-adaptor.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ Here is a sample array entry for `validBidRequests[]`:
301301
bidId: "22c4871113f461",
302302
bidder: "rubicon",
303303
bidderRequestId: "15246a574e859f",
304+
pageViewId: 'de48e8d1-25e1-487c-96c6-41fcef84b41b',
304305
bidRequestsCount: 1,
305306
bidderRequestsCount: 1,
306307
auctionsCount: 1,
@@ -322,6 +323,7 @@ Other notes:
322323
* **Bid ID** is unique across ad units and bidders.
323324
* **auctionId** (see [note](#tid-warning)) is unique per call to `requestBids()`, but is the same across ad units and bidders.
324325
* **Transaction ID** (see [note](#tid-warning)) is unique for each ad unit within a call to `requestBids()`, but same across bidders. This is the ID that enables DSPs to recognize the same impression coming in from different supply sources.
326+
* **Page view ID** is unique for a page view (one load of Prebid); can also be refreshed programmatically. Shared across all requests and responses within the page view, for the same bidder. Different bidders see a different page view ID.
325327
* **Bid Request Count** is the number of times `requestBids()` has been called for this ad unit.
326328
* **Bidder Request Count** is the number of times `requestBids()` has been called for this ad unit and bidder.
327329
* **Auctions Count** is the number of times `requestBids()` has been called for this ad unit excluding the duplicates generated by twin adUnits.
@@ -340,6 +342,7 @@ Here is a sample bidderRequest object:
340342
auctionStart: 1579746300522,
341343
bidderCode: "myBidderCode",
342344
bidderRequestId: "15246a574e859f",
345+
pageViewId: 'de48e8d1-25e1-487c-96c6-41fcef84b41b',
343346
bids: [{...}],
344347
gdprConsent: {consentString: "BOtmiBKOtmiBKABABAENAFAAAAACeAAA", vendorData: {...}, gdprApplies: true},
345348
ortb2: {...},
@@ -720,6 +723,7 @@ Sample data received by this function:
720723
auctionStart: 1579746300522,
721724
bidderCode: "myBidderCode",
722725
bidderRequestId: "15246a574e859f",
726+
pageViewId: 'de48e8d1-25e1-487c-96c6-41fcef84b41b',
723727
bids: [{...}],
724728
gdprConsent: {consentString: "BOtmiBKOtmiBKABABAENAFAAAAACeAAA", vendorData: {...}, gdprApplies: true},
725729
refererInfo: {

dev-docs/modules/pubCommonId.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Adapters should look for `bid.crumbs.pubcid` in buildRequests() method.
8383
"sizes":[[300, 250], [300,600]],
8484
"bidId":"222187f1ef97e6",
8585
"bidderRequestId":"12088b9bd86f26",
86+
"pageViewId": "861a2d06-e70a-4db9-8620-47d3d1f4f301",
8687
"auctionId":"a1a98ab2-97c9-4f42-970e-6e03040559f2"
8788
}
8889
]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
layout: api_prebidjs
3+
title: pbjs.refreshPageViewId
4+
description:
5+
sidebarType: 1
6+
---
7+
8+
Refreshes the previously generated page view ID. Can be used to instruct bidders that use page view ID to consider future auctions as part of a new page load.
9+
10+
```javascript
11+
// Function to call when the URL changes
12+
function onUrlChange() {
13+
pbjs.refreshPageViewId();
14+
}
15+
16+
// Function to initialize the URL change listener
17+
function initUrlChangeListener() {
18+
// Listen for changes to the history state
19+
window.addEventListener('popstate', onUrlChange);
20+
21+
// Optionally, you might want to handle the initial load as well
22+
onUrlChange();
23+
}
24+
25+
// Call the function to set up the listener
26+
initUrlChangeListener();
27+
28+
```
29+
30+
<hr class="full-rule" />

prebid-server/developers/add-new-bidder-go.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ The second argument, `requestInfo`, is for extra information and helper methods
778778
- `requestInfo.PbsEntryPoint` to access the entry point of the bid request, commonly used to determine if the request is for AMP or for a [Long Form Video Ad Pod](/dev-docs/modules/adpod.html).
779779
- `requestInfo.GlobalPrivacyControlHeader` to read the value of the `Sec-GPC` Global Privacy Control (GPC) header of the bid request.
780780
- `requestInfo.ConvertCurrency` a method to perform currency conversions.
781+
- `requestInfo.PageViewId` is the unique identifier for the page view (one load of Prebid.js); can also be refreshed programmatically. Shared across all requests and responses within the page view, for the same bidder. Different bidders see a different page view ID.
781782

782783
The `MakeRequests` method is expected to return a slice (similar to a C# `List` or a Java `ArrayList`) of `adapters.RequestData` objects representing the HTTP calls to be sent to your bidding server and a slice of type `error` for any issues encountered creating them. If there are no HTTP calls or if there are no errors, please return `nil` for both return values. Please do not add `nil` items in the slices.
783784

0 commit comments

Comments
 (0)