-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
LKQD: update adapter to include new parameters #6033
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 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 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
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.
I do not think this is the most efficient way to do this. It does not seem likely that you will have all 40 or even close to that of these in each bidRequest.
I would think simply looping over each param and adding it is the right thing to do.
With the above code, we only loop as many times as needed.
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.
We do not require c numbered data to be sent in sequential order and is passed along only if it exists. Your code would also iterate over all the parameters passed in and not our selectively targeted version. My for loop only looks for c1...c40 because all other known accepted data has been picked out.
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.
Right, but it is not common for a bid adapter to take in 40+ bidParams.
Looks like 2 params are required for your adapter.
So in what seems to be the usual case, it seems as though looping over the params which the pub set is more efficient on average.
Unless your bidder is unique and you make publishers set 40+ unique LKQD params each time.
Another option is to filter the params looking for the c params, then add those.
Also, regarding the logic of a bunch of if / else's for each bid param. Looks like each bid param name directly maps 1:1 to the associated SSPData name as well.
So why can we just not loop over bid params and just add them?
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.
At this time the correction of my predecessor's code regarding the if statements are out of scope and of course needs to be done. For this particular task, I have to minimize changes to the addition of coppa and c1...c40. So this is why I chose the for loop that limits the count to 40 instead of doing the generic loop, that is something that can be adopted in a future revision.
For some context on the c data, it is custom data that we allow publisher partners to put into our system and pass along. For better or worse they can put whatever string they want. Custom Parameters Doc
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.
Ok sounds good.
Not meaning to be too combative. Just wanted to double check!
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.
No worries, constructive help is always welcomed and I will try to do my part and explain as best I can. This was my first encounter with this code as a result of client requests, the code base along with its companion test is now on my growing list of things to change/improve. Have a good one!