Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for usnat supported api lookup (#1804)
## Why? Since 19/11/2034 ~ 18:00 UTC the consent state property `doNotSell` is being set to true for all US users regardless of their consent choice. This mean third party integrations that check for `doNotSell` before loading are not running e.g. prebid, comscore and a9 (Amazon ads). ### gppData We read the `gppData` object as provided by Sourcepoint: <img src="https://github.com/user-attachments/assets/fec25081-79dc-4e89-b19e-d7c032f91061" width="300px" /> ### supportedAPIs string In order to lookup the usnat metadata we read the `gppData.supportedAPIs` property and split the string to set the `supportedAPIs` string (e.g. `usnat`) ### supportedAPIs lookup We then use the `supportedAPIs` string to lookup the property on `gppData.parsedSection[supportedAPIs]` However currently the `supportedAPIs` string is resolving to `usnat` but the property on `gppData.parsedSection` is `usnatv1` This causes the lookup to fail and sets `doNotSell` to true. ## What are you changing? This change updates the logic so rather than using the `supportedAPIs` string it directly attempts to read the first object in `gppData.parsedSection`.
- Loading branch information