Skip to content

KV mismatch in GAM: cust_param handling in gamAdServerVideo.js uses formatQS() which handles arrays explicitly with bracket notation #15357

Description

@suchhanda-crazygames

The cust_param handing in getCustParams() func in modules/gamAdServerVideo.js uses src/util formatQS() which handles arrays explicitly with PHP-style bracket notation. This converts custom KV pairs, which needs to be sent to GAM, like below:

From:
bidders_enabled: ['ix', 'rubicon']
to
bidders_enabled[]=ix&bidders_enabled[]=rubicon

causing reporting mismatch in GAM.

I can see that this func was added in this commit along with func parseQS (which does the opposite and removes the [])

I see only 2 consumers feed formatQS() a raw JS array and trigger k[]=v output:

  1. gamAdServerVideo.js where the issue is happening
  2. adlooxAnalyticsAdapter.js where i see a comment addressing the issue.
  3. modules/adlooxRtdProvider.js - which uses buildUrl(internally uses formatQS) and then strips the []

I can also see that libraries/medianetUtils/utils.js has pivoted to use its own formatQS definition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status
    Ready for Dev

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions