question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong decoding of custom purposes on IAB TCF Code Library and CMP Validator

See original GitHub issue

I’ve encoded a TCString including a PublisherTC segment with the following purposes:

  • purpose 1 on consent
  • purpose 5 on legitimate interest
  • 2 custom purposes on consent
  • 1 custom purpose on legitimate interest

Here is the TCString: COwnRWbOwnRZLBcABBENAdCsAP_AAH_AAAqIF0EWSQgCYWghI0QUBxBAIYAfJgSCAMgCAAQIoSgFQISERBAGKiAQHAEQJAAAGBAAEACAAQAgHGBMCQAAgAABiRCEQUGICzNIBIBAggEaYUFAAAVmGkHCmZCY70ywOmQLoIIEBAEAkABAIAADECAQwAQDAAAAYAkAAABAhIKAAgIiAAEcAAAAAAgAAAAAAABAAAAAAAAAICIAAABAAAgAiAAAAAAGgIQAACBAAAAQIAAAAANAAAAiCEAQgoEAIgAA.cAAAAQAAAeI

When encoding the TCString, I set the custom purposes fields as follows:

  • NumCustomPurposes = 3
  • CustomPurposesConsent = 110
  • CustomPurposesLITransparency = 001

Through the API, our CMP surfaces the TCData object as expected: getTCData

But when I decode the TCString in the IAB TCF Code Library, the decoder doesn’t split the custom purposes in consent and legitimate interest. Instead of decoding 3 consents and 3 legitimate interests, the decoder interprets 6 consents. iab-decoder

The same problem occurs in the CMP Validator: cmp-validator

I think both tools need to take in consideration the NumCustomPurposes field to split the purposes.

Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
chrispatersoncommented, Apr 10, 2020

Nice catch @laurent-chriqui, I had forgotten that those are viable length encodings. I’ll need to open a new issue to fix that.

0reactions
laurent-chriquicommented, Apr 10, 2020

From what I have seen in the code: CustomPurposesConsent and CustomPurposesLITransparency have a bitlength of 24 instead of NumCustomPurposes

I think there was a mistake in this fix: https://github.com/InteractiveAdvertisingBureau/iabtcf-es/issues/52

publisherConsents was mistaken with the two fields afore mentionned which should not have a fixed bitlength.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting TCF v2.0 implementation - Google Support
The TC string is not parseable because it isn't base64 encoded. CMPs (or publishers) should only send base64 encoded data in gdpr_consent= parameters....
Read more >
Google IAB TCF 2.0 Error Codes and Guidance
Error Description Suggested Action 6.1 TC string version is 1 or 1.1 (v1.0 string). CMP should send TCF v2.0 strings. 7.8 TC string version field...
Read more >
TCF CMP releases - Gravito
This is to help with validation of CMP functions, copied TCstring can be validated and analyzed at http://iabtcf.com/#/decode independently.
Read more >
@iabtcf/cmpapi - npm
The CMP is responsible for handling validations and errors. Custom function signatures must have a callback and may define additonal params ...
Read more >
Do Cookie Banners Respect my Choice? - arXiv
To become a part of the TCF, each CMP and advertiser must register with IAB. Europe. As a result, IAB Europe maintains: (1)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found