Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving Vendor Id 126 for Double Verify doesn't save into TC Consent string #427

Open
n-lee-commits opened this issue Oct 26, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@n-lee-commits
Copy link

Version

1.5.9

Module (core, cmpapi, cli, stub, or testing)
core

Describe with reproduction steps – What is the expected behavior?

Currently trying to save vendor 126 Double Verify into TC String using the encode functionality. The encode functionality doesn't directly save 126 into the cookie.

Screen Shot 2023-10-26 at 4 01 29 PM

This is the output I got from the decoder:

Screen Shot 2023-10-26 at 4 24 59 PM

And the encoded TC String:

CPywmUAPywmUADgACMENAYEgAAAAAAAAAAAAAZQAwAQAAqABkAAAAAAA.YAAAAAAAAAAA

@n-lee-commits n-lee-commits added the bug Something isn't working label Oct 26, 2023
@marco-prontera
Copy link
Contributor

Hi, I also tried it with version 1.4.0 and it does the same thing, so I think it's something (I don't know if it's an actual bug) that has been around for a long time.

I see that the vendor doesn't have any purposes but only legInt purposes, maybe that is the problem?

@jedlikk
Copy link

jedlikk commented Feb 13, 2024

Hello! We are also struggling with this issue. Same thing happens when you are trying to accept for example "Mirando" ID: 279. Any updates about planned fixes?

@HeinzBaumann
Copy link
Collaborator

If there is no purpose to consent specified for a vendor that vendor cannot be written out as having consent. If the vendor specifies LegInt for purposes, the vendor can continue operating for the declared purposes under LegInt unless the user opted out of LegInt. If the vendor specifies FlexPurposes that will allow the publisher through the CMP to override the purpose declaration and if in this case the purpose(s) is/are set to consent, the vendor bit will be written for consent if consent is given. the library handles publisher overrides, hence you can mimic this behavior through library calls.
I hope this makes sense.

@jedlikk
Copy link

jedlikk commented Feb 14, 2024

Thank you for your answer. I think i understand the idea but not sure how to handle it within TcModel.
For example: I use tcModel.vendorConsents.set() to set every vendor that user has consented to. When i check tcModel i ineed have 728 vendorsConsented, but when i take encoded tcString to decoder it shows only 665. Example encoded tcstring:
"CP5-BkAP5-BkAF-feBENAXEsAP_gAEPgAAQ4JutV_H__bW9r8Tr1aft0eYlH99j77uQxBhfJE-4FyDvW_JwVh2EwNA06tqIKmRIEuzZBIQFkHJHURVigSogVryHsYkGMhTMIJ6BkgFMRI2dYCFxvmYtjEQIY5_p_d3fx2B-t_dn83czjT8FHnzU5P2ckcKCdQ58tDfl9bRKb-5IOd-70v4v09lfrkW_eTVm_pcvr7B-ufs8r_XU-9-CbgBJhoXEAXYEAIRaBhFAgBEFYQEUCgAAAEgaICAEgYFOwMAB1gIgAACgAGCAEAAKMgAQAAAAAIRABIAUCAACAQCAAAAAAQCAAgYABQAWAgEAAIDoGKYQACAWECRGREKYEIUCQQEtlAgkBQIK4QBBlgBQCImAgAQAAAKwAAAWKwGAJAQoSCBLKDaAAAgAQCilCoQSeGAAYEjZagcETAAAA.YAAAAAAAAAAA"
image

My component and how i handle it:
`const tcModel = new TCModel(new GVL(gvl));
tcModel.cmpId = TCF_CMP_ID // my CMP ID
tcModel.cmpVersion = convertSemanticVersion(APP_VERSION) // my CMP Version
tcModel.consentScreen = TCF_CONSENT_SCREEN // On which 'screen' consent was captured;
tcModel.consentLanguage = userLang;
tcModel.publisherCountryCode = state.tcfCountry;
tcModel.isServiceSpecific = TRUE;

// Convert user consent to arrays where in array are only options that are enabled by user
// Convert it to array ids as numbers. Expected result: [id1, id2, id3]
tcModel.vendorConsents.set(TCFConvertConsentToSupportedFormat(state.userConsent.vendors));
tcModel.vendorLegitimateInterests.set(TCFConvertConsentToSupportedFormat(state.userConsent.vendorsLegitimateInterest));

// Loop through all categories and add them
TCF_VENDOR_CATEGORIES_TYPES.forEach(category => {
  if (category.hasSwitch) {
    if (!category.IABLibName) {
      console.error("TCF category with switch is missing IAB LIB name")
      return;
    }

    // Add purposes and special features if they exist in user consent
    if (state.userConsent.categories[category.key]) {
      tcModel[category.IABLibName].set(TCFConvertConsentToSupportedFormat(state.userConsent.categories[category.key]));
    }

    if (category.hasLegitimateInterest) {
      if (!category.IABLibLegitimateInterestName) {
        console.error("TCF category with switch is missing IAB LIB legitimate interest name")
        return;
      }

      if (state.userConsent.categoriesLegitimateInterest[category.key] && category.hasLegitimateInterest) {
        tcModel[category.IABLibLegitimateInterestName].set(TCFConvertConsentToSupportedFormat(state.userConsent.categoriesLegitimateInterest[category.key]));
      }
    }
  }
})

console.log({ tcModel, code: TCString.encode(tcModel) })
return TCString.encode(tcModel);`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants