Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

sizeGroup error on joinAdInterestGroup #970

Open

Description

@onetag-dev

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

Activity

  1. JensenPaul commented on Jan 5, 2024

    @JensenPaul
    Collaborator

    @gtanzer to take a look

  2. onetag-dev commented on Jan 23, 2024

    @onetag-dev
    ContributorAuthor

    Hi, is there any news on this matter? Thanks

  3. gtanzer commented on Jan 23, 2024

    @gtanzer
    Contributor

    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

  4. xiaochen-z commented on Jan 23, 2024

    @xiaochen-z
    Contributor

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

  5. xiaochen-z commented on Jan 31, 2024

    @xiaochen-z
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions