Skip to content

Fix: Valid CCPA consent was dropped when gdpr_applies=true - #4900

Open
karwaankit32 wants to merge 2 commits into
prebid:masterfrom
karwaankit32:ccpa-consent-bugfix
Open

Fix: Valid CCPA consent was dropped when gdpr_applies=true#4900
karwaankit32 wants to merge 2 commits into
prebid:masterfrom
karwaankit32:ccpa-consent-bugfix

Conversation

@karwaankit32

Copy link
Copy Markdown
Contributor

Fixing bug - #4867

przemkaczmarek
przemkaczmarek previously approved these changes Aug 13, 2026
errorMsgs: []string{"Consent string 'XXXX' is not a valid CCPA consent string."},
},
},
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of these test cases in amp_auction_test.go set ConsentType: amp.ConsentUSPrivacy. The default: branch of ReadPolicy (unset consent_type, i.e. ConsentType == 0) is also affected by the fix but untested. Add a case that omits ConsentType (defaults to 0 → default branch):


        {
            desc: "amp.Params default consent_type with valid CCPA consent and gdpr_applies true - expect consent warning and remaining overrides applied",
            given: testInput{
                ampParams: amp.Params{
                    Consent:     "1YNN",
                    // ConsentType intentionally unset -> auto-detect (default branch)
                    GdprApplies: &gdprApplies,
                    Targeting:   `{"foo":"bar"}`,
                    Timeout:     &timeout,
                    Trace:       "verbose",
                },
                bidRequest: &openrtb2.BidRequest{
                    Imp: []openrtb2.Imp{{Banner: &openrtb2.Banner{Format: []openrtb2.Format{}}}},
                },
            },
            expected: testOutput{
                bidRequest: &openrtb2.BidRequest{
                    Imp: []openrtb2.Imp{{
                        Banner: &openrtb2.Banner{Format: []openrtb2.Format{}},
                        Ext:    json.RawMessage(`{"data":{"foo":"bar"}}`),
                    }},
                    Regs: &openrtb2.Regs{USPrivacy: "1YNN"},
                    Site: &openrtb2.Site{Ext: json.RawMessage(`{"amp":1}`)},
                    TMax: 500,
                    Ext:  json.RawMessage(`{"prebid":{"trace":"verbose"}}`),
                },
                errorMsgs: []string{"AMP request gdpr_applies value was ignored because provided consent string is a CCPA consent string"},
            },
        },

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@bsardo bsardo changed the title Fixing bug related to valid CCPA consent dropped when gdpr_applies=true Fix: Valid CCPA consent was dropped when gdpr_applies=true Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants