US states laws

For US states laws, we recommend disabling Prebid when a user has opted out of personal data processing (selling, sharing, etc.).

This can be implemented by adding code on your website to only request bids when the user has not opted out.

Code sample

window.didomiOnReady = window.didomiOnReady || [];
window.didomiOnReady.push(function (Didomi) {
    const userStatus = window.Didomi.getCurrentUserStatus();

    if (
        userStatus.regulation == 'cpra'
        || userStatus.regulation == 'cpa'
        || userStatus.regulation == 'ucpa'
        || userStatus.regulation == 'ctdpa'
        || userStatus.regulation == 'vcdpa'
    ) {
        if (
            !!Object
                .values(userStatus.purposes)
                .find(purpose => purpose.enabled === false)
        ) {
            // User has opted out, do not load prebid ads
            // Load non-prebid ads via GAM or another ad server
        } else {
            // User has not opted out, load prebid ads and your usual ad logic without restriction
        }
    }
});

Last updated