Skip to content

getConsentData is not queued when modal is still open #212

@BartVB

Description

@BartVB

I'm trying to integrate DigiTrust CMP with Prebid.js but that's not going smoothly so far.

The main problem is that Prebid calls:

https://github.com/prebid/Prebid.js/blob/master/modules/consentManagement.js#L89

cmpFunction('getConsentData', null, callbackHandler.consentDataCallback);
cmpFunction('getVendorConsents', null, callbackHandler.vendorConsentsCallback);

Which return 'undefined' and 'Could not find cookieVersion to encode' if consentData is not available yet.

Instead of instantly returning, the CMP should queue these commands until consent data is available. There is code for this but that doesn't seem to work:

https://github.com/digi-trust/cmp/blob/master/src/lib/cmp.js#L424

Edit: The problem seems to be that this.store.persistedVendorConsentData has been initialized to an empty object at that point. Because of that no command is ever queued. I fixed this by checking for an empty object, but I'm not sure that this is the right way to go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions