Skip to content
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

sizeGroup error on joinAdInterestGroup #970

Open
onetag-dev opened this issue Jan 5, 2024 · 5 comments
Open

sizeGroup error on joinAdInterestGroup #970

onetag-dev opened this issue Jan 5, 2024 · 5 comments

Comments

@onetag-dev
Copy link
Contributor

In the following link, the possibility of specifying the optional fields 'adSizes' and 'sizeGroups' is indicated. In particular:

Each named ad size is also considered a size group, so you don't need to manually define singleton size groups; for example see the sizeGroup: 'size3' code above

However, we receive the following error when using named sizes in the interest group:
TypeError: Failed to execute 'joinAdInterestGroup' on 'Navigator': ads[2].sizeGroup 'size3' for AuctionAdInterestGroup with owner 'https://www.example-dsp.com' and name 'womens-running-shoes' The assigned size group does not exist in sizeGroups map.

This example gives error:

navigator.joinAdInterestGroup({
  'owner': 'https://www.example-dsp.com',
  'name': 'womens-running-shoes',
  'lifetimeMs': 8000,
  'priority': 0.0,
  'priorityVector': {
    'signal1': 2,
    'signal2': -3.5,
  },
  'prioritySignalsOverrides': {
    'signal1': 4.5,
    'signal2': 0,
  },
  'enableBiddingSignalsPrioritization' : true,
  'biddingLogicURL': "https://www.example-dsp.com/bidding_logic.js",
  'trustedBiddingSignalsKeys': ['key1', 'key2'],
  'ads': [{renderUrl: 'https://www.example-dsp.com/render', sizeGroup: 'group1'},
          {renderUrl: 'https://www.example-dsp.com/render', sizeGroup: 'group2'},
          {renderUrl: 'https://www.example-dsp.com/render', sizeGroup: 'size3'}],
  'adSizes': {'size1': {width: 300, height: 250},
              'size2': {width: 300, height: 600},
              'size3': {width: 728, height: 90},
              'size4': {width: 160, height: 600}},
  'sizeGroups': {'group1': ['size1', 'size2', 'size3'],
                 'group2': ['size3', 'size4']},
  'auctionServerRequestFlags': ['omit-ads'],
})

This, on the other hand, works correctly (there are only sizeGroup specified):

navigator.joinAdInterestGroup({
  'owner': 'https://www.example-dsp.com',
  'name': 'womens-running-shoes',
  'lifetimeMs': 8000,
  'priority': 0.0,
  'priorityVector': {
    'signal1': 2,
    'signal2': -3.5,
  },
  'prioritySignalsOverrides': {
    'signal1': 4.5,
    'signal2': 0,
  },
  'enableBiddingSignalsPrioritization' : true,
  'biddingLogicURL': "https://www.example-dsp.com/bidding_logic.js",
  'trustedBiddingSignalsKeys': ['key1', 'key2'],
  'ads': [{renderUrl: 'https://www.example-dsp.com/render', sizeGroup: 'group1'},
          {renderUrl: 'https://www.example-dsp.com/render', sizeGroup: 'group2'},
          {renderUrl: 'https://www.example-dsp.com/render', sizeGroup: 'group1'}],
  'adSizes': {'size1': {width: 300, height: 250},
              'size2': {width: 300, height: 600},
              'size3': {width: 728, height: 90},
              'size4': {width: 160, height: 600}},
  'sizeGroups': {'group1': ['size1', 'size2', 'size3'],
                 'group2': ['size3', 'size4']},
  'auctionServerRequestFlags': ['omit-ads'],
})

Can't we just specify named sizes in sizeGroup field? Thank you in advance

@JensenPaul
Copy link
Collaborator

@gtanzer to take a look

@onetag-dev
Copy link
Contributor Author

Hi, is there any news on this matter? Thanks

@gtanzer
Copy link
Contributor

gtanzer commented Jan 23, 2024

Sorry, missed this in the new year's shuffle. I think we just missed implementing this part of the explainer, should be easy to fix. Tagging @xiaochen-z

@xiaochen-z
Copy link
Contributor

The current implementation does miss this specified behavior. I will work on a fix.

@xiaochen-z
Copy link
Contributor

After discussing with the Protected Audience team, we have decided to support this functionality in the future. I have a pull request #1008 to update the explainer.

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

No branches or pull requests

4 participants