feature(tercept analytics adapter) -> add page load logic#2
Open
mdusmanalvi wants to merge 5 commits into
Open
feature(tercept analytics adapter) -> add page load logic#2mdusmanalvi wants to merge 5 commits into
mdusmanalvi wants to merge 5 commits into
Conversation
- Replace shared events object with per-auctionId Map to fix data loss when multiple auctions run concurrently - Accumulate BID_WON, AD_RENDER_SUCCEEDED, AD_RENDER_FAILED and BIDDER_ERROR into the bids array; flush once 1.5s after AUCTION_END - Use navigator.sendBeacon on visibilitychange so data survives page exit - Add disableAnalytics to clear pending timers and maps on teardown - Add try/catch around track() to prevent adapter errors disrupting page - Remove ad, native and adUrl fields from bid payloads to reduce size - Limit auctionInit.bidderRequests to first entry (device/site data is identical across all bidder requests) - Add is_pl flag (true on first bid of first auction per page load)
Replace tests that assumed multiple requests per auction and separate top-level keys (bidWon, adRenderSucceeded, etc.) with tests matching the new single-request-per-auction design. Covers: - Request timing: no send before 1.5s timer, one request per auction - Payload structure: top-level shape, bidderRequests trimmed to first, host/path/search attached at send time, ad/native/adUrl absent - All event handlers: BID_REQUESTED, BID_RESPONSE, BID_TIMEOUT, NO_BID, BID_WON, AD_RENDER_SUCCEEDED, AD_RENDER_FAILED, BIDDER_ERROR - is_pl flag: true on first bid of first auction only, reset on disable - Concurrent auction isolation: separate bids and auctionInit per id - visibilitychange flush via sendBeacon - disableAnalytics: cancels timers, clears maps, resets firstSent - Error resilience: unknown auctionIds and undefined args do not throw
…mport - Fix 81 indent errors by properly indenting the try block body - Replace window.addEventListener with document.addEventListener for visibilitychange — the event is non-bubbling and fires on document, so window never received it in Firefox/Safari - Replace navigator.sendBeacon with the ajax.js sendBeacon wrapper as required by Prebid.js linting rules - Update test to stub ajax.sendBeacon and dispatch event on document
Split multi-property spread objects onto separate lines to satisfy the @stylistic/object-property-newline ESLint rule.
Sets is_pl=true on every bid in the first auction fired on the page, false on all subsequent auctions. Resets on disableAnalytics so the flag behaves correctly if the adapter is torn down and re-enabled. Updates expectedAfterBid fixture to include is_pl so the existing deep-equal assertion continues to pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
Bugfix
Feature
New bidder adapter
Updated bidder adapter
Code style update (formatting, local variables)
Refactoring (no functional changes, no api changes)
Build related changes
CI related changes
Does this change affect user-facing APIs or examples documented on http://prebid.org?
Other
Description of change
Other information