Skip to content

Adding v1.6 of measurement/init script#2

Open
pmarkert wants to merge 3 commits intomainfrom
1.6
Open

Adding v1.6 of measurement/init script#2
pmarkert wants to merge 3 commits intomainfrom
1.6

Conversation

@pmarkert
Copy link
Contributor

No description provided.

  - explicit
  - percentage selection
  - automatic
- Use pbjs.cmd to get later in the pipeline
- Auto-configures storage based upon auctionDelay
- Controllable via lipid
@pmarkert pmarkert requested a review from 3link March 28, 2024 15:59
if (LI_MODULE_ENABLED) {
(function () {
// start liveintent module init and measurement script v1.6
const pbjs = (window.pbjs = window.pbjs || { cmd: [] });
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worth making it more explicit that pbjs should be replaced with whatever the global var name is in case it is a custom one?

For example by adding something like

// Replace with a different global name if needed
const prebidGlobalVarName = 'pbjs'
const pbjs = (window[prebidGlobalVarName] = window[prebidGlobalVarName] || { cmd: [] });

// start liveintent module init and measurement script v1.6
const pbjs = (window.pbjs = window.pbjs || { cmd: [] });

pbjs.cmd.push(() => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the script relies on Prebid configuration being present before this function is executed. For example, if

pbjs.que.push(function() {
    pbjs.setConfig({...})
}

is executed after line 16 is executed to set the actual Prebid configuration, it will overwrite whatever config has been computed by this script. Do I see it correctly?

Comment on lines +42 to +54
params: Object.assign(
{
requestedAttributesOverrides: {
uid2: true,
bidswitch: true,
medianet: true,
magnite: true,
pubmatic: true,
index: true,
openx: true,
},
},
window.liModule.params
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the intention to allow to provide params for configuring the module via a global variable? If so, what is the reason to have the hardcoded config here? Is it a fallback? What happens if it is not the list of IDs the customer wants? Would it make sense to require providing a config explicitly instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments