InteractiveAdvertisingBureau / Global-Privacy-Platform

IAB Tech Lab Global Privacy Platform specification
72 stars 36 forks source link

getField / command clarification #69

Closed mdurrant closed 1 year ago

mdurrant commented 1 year ago

I'm finishing up a GPP api and I'm operating under the assumption the following example from the spec is incorrect.

For example, a client can ask the CMP to get the last updated field from the IAB TCF v2.0 TCData. var s = __gpp('getField',null, "tcfeuv2.LastUpdated");

I'm assuming TCData is the intended object, but since "LastUpdated" is part of TCModel this command wouldn't return the desired result.

Should the fields be case sensitive? I am treating them as such, with camel-casing. In my implementation __gpp('getField',null, "tcfeuv2.eventStatus"); will return the same result as __gpp('getSection',null, 'tcfeuv2')?.eventStatus;, but __gpp('getField',null, "tcfeuv2.EventStatus"); will always return null because of the casing.

janwinkler commented 1 year ago
  1. Please note that the described way will now be removed with gpp 1.1 (use callbacks instead of return values). see https://github.com/InteractiveAdvertisingBureau/Global-Privacy-Platform/pull/70/files?short_path=d39e979
  2. please also note that exactly these examples are no longer allowed by the TCF (use addEventListener instead of getTCData or similar function).

taking that aside: I would treat the fields as case sensitive and in the writing that they have in the GPP section specification. E.g. TCF EUR does not have an eventStatus field but Version, Created, LastUpdated, CmpId, ... (https://github.com/InteractiveAdvertisingBureau/Global-Privacy-Platform/blob/main/Sections/EEA/GPPExtension%3A%20IAB%20Europe%20TCF.md)

the getSection command will also be updated, therefore the equivalent of __gpp('getField', function (data, success){ /* use data */ }, 'tcfeuv2.LastUpdated'); would be __gpp('getSection', function (data, success){ /* use data[0].LastUpdated */ },'tcfeuv2');