diff --git a/dev-docs/bidder-adaptor.md b/dev-docs/bidder-adaptor.md index 94a35f59bb..006a2019cb 100644 --- a/dev-docs/bidder-adaptor.md +++ b/dev-docs/bidder-adaptor.md @@ -301,6 +301,7 @@ Here is a sample array entry for `validBidRequests[]`: bidId: "22c4871113f461", bidder: "rubicon", bidderRequestId: "15246a574e859f", + pageViewId: 'de48e8d1-25e1-487c-96c6-41fcef84b41b', bidRequestsCount: 1, bidderRequestsCount: 1, auctionsCount: 1, @@ -322,6 +323,7 @@ Other notes: * **Bid ID** is unique across ad units and bidders. * **auctionId** (see [note](#tid-warning)) is unique per call to `requestBids()`, but is the same across ad units and bidders. * **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. +* **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. * **Bid Request Count** is the number of times `requestBids()` has been called for this ad unit. * **Bidder Request Count** is the number of times `requestBids()` has been called for this ad unit and bidder. * **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: auctionStart: 1579746300522, bidderCode: "myBidderCode", bidderRequestId: "15246a574e859f", + pageViewId: 'de48e8d1-25e1-487c-96c6-41fcef84b41b', bids: [{...}], gdprConsent: {consentString: "BOtmiBKOtmiBKABABAENAFAAAAACeAAA", vendorData: {...}, gdprApplies: true}, ortb2: {...}, @@ -720,6 +723,7 @@ Sample data received by this function: auctionStart: 1579746300522, bidderCode: "myBidderCode", bidderRequestId: "15246a574e859f", + pageViewId: 'de48e8d1-25e1-487c-96c6-41fcef84b41b', bids: [{...}], gdprConsent: {consentString: "BOtmiBKOtmiBKABABAENAFAAAAACeAAA", vendorData: {...}, gdprApplies: true}, refererInfo: { diff --git a/dev-docs/modules/pubCommonId.md b/dev-docs/modules/pubCommonId.md index 461580f3ef..50322e12c0 100644 --- a/dev-docs/modules/pubCommonId.md +++ b/dev-docs/modules/pubCommonId.md @@ -83,6 +83,7 @@ Adapters should look for `bid.crumbs.pubcid` in buildRequests() method. "sizes":[[300, 250], [300,600]], "bidId":"222187f1ef97e6", "bidderRequestId":"12088b9bd86f26", + "pageViewId": "861a2d06-e70a-4db9-8620-47d3d1f4f301", "auctionId":"a1a98ab2-97c9-4f42-970e-6e03040559f2" } ] diff --git a/dev-docs/publisher-api-reference/refreshPageViewId.md b/dev-docs/publisher-api-reference/refreshPageViewId.md new file mode 100644 index 0000000000..a0abf5fdfe --- /dev/null +++ b/dev-docs/publisher-api-reference/refreshPageViewId.md @@ -0,0 +1,30 @@ +--- +layout: api_prebidjs +title: pbjs.refreshPageViewId +description: +sidebarType: 1 +--- + +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. + +```javascript +// Function to call when the URL changes +function onUrlChange() { + pbjs.refreshPageViewId(); +} + +// Function to initialize the URL change listener +function initUrlChangeListener() { + // Listen for changes to the history state + window.addEventListener('popstate', onUrlChange); + + // Optionally, you might want to handle the initial load as well + onUrlChange(); +} + +// Call the function to set up the listener +initUrlChangeListener(); + +``` + +