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

Value gppString in PingData is not updated when section is set to cmpApi. #35

Open
nejcsever opened this issue Sep 8, 2023 · 0 comments · May be fixed by #41
Open

Value gppString in PingData is not updated when section is set to cmpApi. #35

nejcsever opened this issue Sep 8, 2023 · 0 comments · May be fixed by #41

Comments

@nejcsever
Copy link

When setting section value with string section value (cmpApi.setSectionString(sectionName, sectionValue)), gppString is unchanged in PingData object.

Here's the reproducible case where you can see that after setting the UspV1 section value, the gppString in the PingData of the event is still set to "DBAA":

import {CmpApi,CmpDisplayStatus,CmpStatus,SignalStatus,UspV1} from "@iabgpp/cmpapi";
import "@iabgpp/stub";

window.__gpp("addEventListener", (e) => console.log(e));

const cmpApi = new CmpApi(-1, 1);
cmpApi.setApplicableSections([6]);
cmpApi.setCmpStatus(CmpStatus.LOADED);
cmpApi.setSignalStatus(SignalStatus.NOT_READY);
cmpApi.setCmpDisplayStatus(CmpDisplayStatus.VISIBLE);
cmpApi.setSectionString(UspV1.NAME, "1YYY");
cmpApi.setCmpDisplayStatus(CmpDisplayStatus.HIDDEN);
cmpApi.setSignalStatus(SignalStatus.READY);

This happens because the "dirty" boolean flag inside gppModel is not set to true when this method is used (only when fields are updated). I think the case above should be supported. Changes to sections via setSectionString should be reflected in gppString in PingData.

@nejcsever nejcsever changed the title Value gppString in PIngData is not updated when section is set to cmpApi. Value gppString in PingData is not updated when section is set to cmpApi. Sep 8, 2023
@taraschi-sp taraschi-sp linked a pull request Nov 14, 2023 that will close this issue
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 a pull request may close this issue.

1 participant