-
Notifications
You must be signed in to change notification settings - Fork 1
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
TL-36516: Add GPP signals to sync endpoint #80
Conversation
@aikenstl per our discussion, breaking out This prevents me from using the Prebid utils |
modules/tripleliftBidAdapter.js
Outdated
@@ -113,6 +122,13 @@ function _getSyncType(syncOptions) { | |||
if (syncOptions.pixelEnabled) return 'image'; | |||
} | |||
|
|||
function _filterSid(sid) { | |||
return sid.filter(element => { | |||
return element !== null && element !== undefined; |
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 think we should make this
return Number.isInteger(element);
because that's all it should ever be anyway and will also exclude weird nulls/undefineds
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 think I like the way I'm doing it here better. The applicableSections
within the gppConsent
object is an array that we need to do a join(',') on in order to transform it into a comma-separated string to append onto our sync pixel. The filter() is just to make sure the elements are valid
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 meant keep the filter, but replace return element !== null && element !== undefined;
.isInteger
will reject strings, etc which are also not valid, in addition to rejecting null/undefined. But this is a small suggestion so whatev you want
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 misunderstood your original comment. I agree, the way you are suggesting is optimal. Pushing through.
modules/tripleliftBidAdapter.js
Outdated
syncEndpoint = tryAppendQueryString(syncEndpoint, 'gpp', gppConsent.gppString); | ||
} | ||
if (gppConsent.applicableSections && gppConsent.applicableSections.length !== 0) { | ||
syncEndpoint = syncEndpoint + 'gpp_sid=' + _filterSid(gppConsent.applicableSections); |
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.
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.
cc: @aikenstl see Nick's comment above - this will need to be URI encoded. I thought this may be the case - eng will need to account for this (decode this sid) in order to extract the correct gpp_sid
values
Approved as is. Up to you if you want to use isInteger on the filter or not. Otherwise feel free to merge and submit to Prebid as 1 PR (fledge and gpp stuff) |
Type of change
Description of change
Triplelift is adding GPP consent signals to our user sync endpoint when GPP consent data is available