TC String not being decoded.

186 views
Skip to first unread message

Tony Weston

unread,
Feb 19, 2021, 8:27:42 AM2/19/21
to Interactive Media Ads SDK
Hello All, 

I am tasked with putting ads at the start of some of the weather forecast videos we host via Bloomreach.

However, we currently see errors to do with the TC string in the console, when a video is played and while running in debug mode.  I have stepped debug as deep as I can into  ima3_debug.js, up until the lines below, which throws an error with the coreString I am passing.

module$exports$contentads$shared$adtech$iabtcfv2$js$TcfCoreStringCodec.decode = function(coreString) { try { var bitString = goog.crypt.base64.decodeStringToByteArray(coreString).map(function(byte) { return byte.toString(2).padStart(8, "0"); }).join(""), tcDecoder = new module$exports$contentads$shared$adtech$iabtcfv2$js$TcDecoder(bitString); return (new proto.contentads.shared.ad_tech.iab_tcf_v2.TcfCoreString).setVersion(tcDecoder.decodeInt(module$exports$contentads$shared$adtech$iabtcfv2$js$TcStringConstants.VERSION_FIELD_LENGTH)).setCreated(tcDecoder.decodeTimestamp()).setLastUpdated(tcDecoder.decodeTimestamp()).setConsentManagementPlatformId(tcDecoder.decodeInt(module$exports$contentads$shared$adtech$iabtcfv2$js$TcStringConstants.CMP_ID_FIELD_LENGTH)).setConsentManagementPlatformVersion(tcDecoder.decodeInt(module$exports$contentads$shared$adtech$iabtcfv2$js$TcStringConstants.CMP_VERSION_FIELD_LENGTH)).setConsentScreen(tcDecoder.decodeInt(module$exports$contentads$shared$adtech$iabtcfv2$js$TcStringConstants.CONSENT_SCREEN_FIELD_LENGTH)).setConsentLanguage(tcDecoder.decodeTwoLetterIsoCode()).setVendorListVersion(tcDecoder.decodeInt(module$exports$contentads$shared$adtech$iabtcfv2$js$TcStringConstants.VENDOR_LIST_VERSION_FIELD_LENGTH)).setTcfPolicyVersion(tcDecoder.decodeInt(module$exports$contentads$shared$adtech$iabtcfv2$js$TcStringConstants.TCF_POLICY_VERSION_FIELD_LENGTH)).setIsServiceSpecific(tcDecoder.decodeBool()).setUseNonStandardStacks(tcDecoder.decodeBool()).setSpecialFeatureOptInsList(tcDecoder.decodeBitfield(module$exports$contentads$shared$adtech$iabtcfv2$js$TcStringConstants.SPECIAL_FEATURE_OPT_INS_FIELD_LENGTH, module$exports$contentads$shared$adtech$iabtcfv2$js$TcStringConstants.ENUM_IAB_TCF_SPECIAL_FEATURE_VALUES)).setPurposesConsentList(tcDecoder.decodeBitfield(module$exports$contentads$shared$adtech$iabtcfv2$js$TcStringConstants.PURPOSES_CONSENT_FIELD_LENGTH, module$exports$contentads$shared$adtech$iabtcfv2$js$TcStringConstants.ENUM_IAB_TCF_PURPOSE_VALUES)).setPurposesLegitimateInterestTransparencyList(tcDecoder.decodeBitfield(module$exports$contentads$shared$adtech$iabtcfv2$js$TcStringConstants.PURPOSES_LEGITIMATE_INTEREST_TRANSPARENCY_FIELD_LENGTH, module$exports$contentads$shared$adtech$iabtcfv2$js$TcStringConstants.ENUM_IAB_TCF_PURPOSE_VALUES)).setPurposeOneTreatment(tcDecoder.decodeBool()).setPublisherCountryCode(tcDecoder.decodeTwoLetterIsoCode()).setVendorsWithConsentList(tcDecoder.decodeVendorIds()).setVendorsWithLegitimateInterestTransparencyList(tcDecoder.decodeVendorIds()).setPublisherRestrictionsList(tcDecoder.decodePublisherRestrictions()); } catch (e) { return goog.log.error(module$contents$contentads$shared$adtech$iabtcfv2$js$TcfCoreStringCodec_logger, "Failed to decode core string: " + e.message), null; } };

The core string that I see passed in is as follows.

CPBGOaFPBGOaFEDAJBENBLCuAP_AAH_AAAwIHTNf_X_fb3_j-_59__t0eY1f9_7_v-0zjheds-8Nyf_X_L8X_2M7vF36pr4KuR4ku3bBIQdtHOncTUmx6olVrTPsbk2Mr7NKJ7PEmnsbe2dYGH9_n9XT_ZKZ79_v___7________7_______3_v_____-_____A6Zr_6_77e_8f3_Pv_9ujzGr_v_f9_2mccLztn3huT_6_5fi_-xnd4u_VNfBVyPEl27YJCDto507iak2PVEqtaZ9jcmxlfZpRPZ4k09jb2zrAw_v8_q6f7JTPfv9____f________f______-_9______3____4AA

This string validates and decodes fine in the following online decoders:

https://www.consentstringdecoder.com/
https://consentstring.io/

Also, using the Java parser from here:

https://github.com/audienceproject/tcf-parser-java 

I think its possibly a bug in your tc_string decoder,  but, maybe I am doing something wrong?
Thanks.

Tony Weston
Snr Developer
The UK Meteorological Office
Exeter, UK.


IMA SDK

unread,
Feb 19, 2021, 11:40:37 AM2/19/21
to ima...@googlegroups.com
Hi Tony,

I tried parsing your TCF example string and got different results from different parsers. For us to investigate further, could you send via "Reply to author" a web address where the TCF string is being created by a CMP with steps to have the error occur? We would also suggest you reach out to your CMP with this information. Alternatively, you may send us the web page via our testing alias imate...@gmail.com with a post on this thread once you have done so.

Regards,

Google Logo
Aryeh Baker
IMA SDK Team
 


ref:_00D1U1174p._5004Q2CSto6:ref

Tony Weston

unread,
Feb 22, 2021, 7:21:01 AM2/22/21
to Interactive Media Ads SDK

I have emailed the testing alias above, with the details you need.


Thanks you,
Tony Weston.

IMA SDK

unread,
Feb 22, 2021, 9:48:58 AM2/22/21
to ima...@googlegroups.com
Hi Tony,

Thank you for the replication steps you sent me privately. I raised this with the rest of my team and will update you as soon as we have more information.

IMA SDK

unread,
Feb 24, 2021, 3:46:42 PM2/24/21
to ima...@googlegroups.com
Hi Tony,

After reviewing your TCF string, my team came to this conclusion:

This TC string gives us:

                "specialFeatureOptins": {
                        "1": true,
                        "2": true,
                        "3": true
                },

However, per https://iabeurope.eu/iab-europe-transparency-consent-framework-policies/#___D_Special_Features__ - there is no special feature with ID #3. So this TC string is malformed and the SDK is working as intended.

Tony Weston

unread,
Feb 25, 2021, 11:59:08 AM2/25/21
to Interactive Media Ads SDK
Thank you for your time and help with this.  I have passed this information back to our CMP providers.

Best regards,
Tony Weston.

Reply all
Reply to author
Forward
0 new messages