Skip to content

Commit 1c34390

Browse files
committed
do not set a default GPP string. keep it backwards compat
1 parent dd91990 commit 1c34390

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

clients/fides-js/src/lib/fidesString.ts

+5-8
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ import { CmpApi } from "@iabgpp/cmpapi";
33
import { FIDES_SEPARATOR } from "./tcf/constants";
44
import { VendorSources } from "./tcf/vendors";
55

6-
/** Default GPP string to use when no CmpApi is provided or when it returns no string */
7-
export const DEFAULT_GPP_STRING = "DBAA";
8-
96
export interface DecodedFidesString {
107
tc: string;
118
ac: string;
@@ -74,15 +71,15 @@ export const idsFromAcString = (acString: string) => {
7471
* Formats the fides_string with the GPP string from the CMP API.
7572
* In a TCF experience, appends the GPP string as the third part.
7673
* In a non-TCF experience, uses empty strings for TCF and AC parts.
77-
* @param cmpApi Optional GPP CMP API instance. If not provided, uses DEFAULT_GPP_STRING
74+
* @param cmpApi Optional GPP CMP API instance.
7875
* @returns The formatted fides_string
7976
*/
80-
export const formatFidesStringWithGpp = (cmpApi?: CmpApi): string => {
81-
const gppString = cmpApi?.getGppString() || DEFAULT_GPP_STRING;
77+
export const formatFidesStringWithGpp = (cmpApi: CmpApi): string => {
78+
const gppString = cmpApi.getGppString();
8279
return window.Fides.options.tcfEnabled
8380
? [...(window.Fides.fides_string?.split(FIDES_SEPARATOR) || []), "", ""]
8481
.slice(0, 2)
85-
.concat(gppString)
82+
.concat(gppString || "")
8683
.join(FIDES_SEPARATOR)
87-
: `,,${gppString}`;
84+
: `,${gppString ? `,${gppString}` : ""}`;
8885
};

clients/fides-js/src/lib/tcf.ts

-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { CmpApi, TCData } from "@iabtechlabtcf/cmpapi";
99
import { GVL, Segment, TCModel, TCString } from "@iabtechlabtcf/core";
1010

1111
import { PrivacyExperience, PrivacyExperienceMinimal } from "./consent-types";
12-
import { formatFidesStringWithGpp } from "./fidesString";
1312
import { ETHYCA_CMP_ID, FIDES_SEPARATOR } from "./tcf/constants";
1413
import { extractTCStringForCmpApi } from "./tcf/events";
1514
import { EnabledIds } from "./tcf/types";
@@ -199,14 +198,6 @@ export const initializeTcfCmpApi = () => {
199198
// Initialize api with TC str, we don't yet show UI, so we use false
200199
// see https://github.com/InteractiveAdvertisingBureau/iabtcf-es/tree/master/modules/cmpapi#dont-show-ui--tc-string-does-not-need-an-update
201200
window.addEventListener("FidesInitialized", (event) => {
202-
// Set default GPP string if GPP is enabled. This will get updated by the GPP extension
203-
if (window.Fides.experience?.gpp_settings?.enabled) {
204-
window.Fides.fides_string =
205-
window.Fides.fides_string ||
206-
window.Fides.cookie?.fides_string ||
207-
formatFidesStringWithGpp();
208-
}
209-
210201
const tcString = extractTCStringForCmpApi(event);
211202
cmpApi.update(tcString, false);
212203
});

0 commit comments

Comments
 (0)