forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 0
AGT-787: partnerAuctionId to analytical module #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dmytro-po
wants to merge
1
commit into
release_0.35
Choose a base branch
from
AGT-787-support-partner-auction-id-in-prebid-module
base: release_0.35
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+18
−11
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -218,7 +218,7 @@ function bidWon(args, isReportExternal) { | |
|
|
||
| if (shouldSendReport(isReportExternal)) { | ||
| const success = receivePartnerData(); | ||
| const preparedPayload = preparePayload(args); | ||
| const preparedPayload = preparePayload(args, isReportExternal); | ||
| if (!preparedPayload) return false; | ||
| if (success === false) { | ||
| preparedPayload[PARAMS_NAMES.terminationCause] = -1 | ||
|
|
@@ -268,7 +268,7 @@ function getRandom(start, end) { | |
| return Math.floor(Math.random() * (end - start + 1) + start); | ||
| } | ||
|
|
||
| export function preparePayload(data) { | ||
| export function preparePayload(data, isReportExternal) { | ||
| const result = getDefaultDataObject(); | ||
| const fullUrl = getCurrentUrl(); | ||
| result[PARAMS_NAMES.partnerId] = iiqAnalyticsAnalyticsAdapter.initOptions.partner; | ||
|
|
@@ -297,7 +297,7 @@ export function preparePayload(data) { | |
| if (iiqAnalyticsAnalyticsAdapter.initOptions.configSource) { | ||
| result[PARAMS_NAMES.ABTestingConfigurationSource] = iiqAnalyticsAnalyticsAdapter.initOptions.configSource | ||
| } | ||
| prepareData(data, result); | ||
| prepareData(data, result, isReportExternal); | ||
|
|
||
| if (shouldSubscribeOnGAM()) { | ||
| if (!reportList[result.placementId] || !reportList[result.placementId][result.prebidAuctionId]) { | ||
|
|
@@ -327,7 +327,7 @@ function fillEidsData(result) { | |
| } | ||
| } | ||
|
|
||
| function prepareData(data, result) { | ||
| function prepareData(data, result, isReportExternal) { | ||
| const adTypeValue = data.adType || data.mediaType; | ||
|
|
||
| if (data.bidderCode) { | ||
|
|
@@ -387,7 +387,12 @@ function prepareData(data, result) { | |
| } | ||
|
|
||
| result.biddingPlatformId = data.biddingPlatformId || 1; | ||
| result.partnerAuctionId = 'BW'; | ||
|
|
||
| if (isReportExternal && data && data.partnerAuctionId) { | ||
| result.partnerAuctionId = data.partnerAuctionId; | ||
| } else { | ||
| result.partnerAuctionId = 'BW'; | ||
| } | ||
| } | ||
|
|
||
| function extractPlacementId(data) { | ||
|
|
@@ -424,6 +429,7 @@ function constructFullUrl(data) { | |
| const reportMethod = iiqAnalyticsAnalyticsAdapter.initOptions.reportMethod; | ||
| const partnerData = window[identityGlobalName]?.partnerData; | ||
| const currentBrowserLowerCase = detectBrowser(); | ||
| const partnerAuctionId = data.partnerAuctionId || 'BW'; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's use only data provided by partner without defaults, and send it only when we have it |
||
| data = btoa(JSON.stringify(data)); | ||
| report.push(data); | ||
|
|
||
|
|
@@ -434,6 +440,7 @@ function constructFullUrl(data) { | |
| baseUrl + | ||
| '?pid=' + | ||
| iiqAnalyticsAnalyticsAdapter.initOptions.partner + | ||
| '&paucid=' + encodeURIComponent(JSON.stringify([partnerAuctionId])) + | ||
| '&mct=1' + | ||
| (iiqAnalyticsAnalyticsAdapter.initOptions?.fpid | ||
| ? '&iiqid=' + encodeURIComponent(iiqAnalyticsAnalyticsAdapter.initOptions.fpid.pcid) | ||
|
|
@@ -451,17 +458,17 @@ function constructFullUrl(data) { | |
| (cmpData.gdprString ? '&gdpr_consent=' + encodeURIComponent(cmpData.gdprString) + '&gdpr=1' : '&gdpr=0'); | ||
| url = appendSPData(url, partnerData); | ||
| url = appendVrrefAndFui(url, iiqAnalyticsAnalyticsAdapter.initOptions.domainName); | ||
|
|
||
| if (reportMethod === 'POST') { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice catch! |
||
| return { url, method: 'POST', payload: JSON.stringify(report) }; | ||
| } | ||
| url += '&payload=' + encodeURIComponent(JSON.stringify(report)); | ||
| url = handleAdditionalParams( | ||
| currentBrowserLowerCase, | ||
| url, | ||
| 2, | ||
| iiqAnalyticsAnalyticsAdapter.initOptions.additionalParams | ||
| ); | ||
|
|
||
| if (reportMethod === 'POST') { | ||
| return { url, method: 'POST', payload: JSON.stringify(report) }; | ||
| } | ||
| url += '&payload=' + encodeURIComponent(JSON.stringify(report)); | ||
| return { url, method: 'GET' }; | ||
| } | ||
|
|
||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need this drilling with
isReportExternal? I'm pretty sure we don't havepartnerAuctionIdproperty inbidWonevent. So why do we need this complicated logic and don't just usepartnerAuctionIdif we have it?