@@ -3,9 +3,6 @@ import { CmpApi } from "@iabgpp/cmpapi";
3
3
import { FIDES_SEPARATOR } from "./tcf/constants" ;
4
4
import { VendorSources } from "./tcf/vendors" ;
5
5
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
-
9
6
export interface DecodedFidesString {
10
7
tc : string ;
11
8
ac : string ;
@@ -74,15 +71,15 @@ export const idsFromAcString = (acString: string) => {
74
71
* Formats the fides_string with the GPP string from the CMP API.
75
72
* In a TCF experience, appends the GPP string as the third part.
76
73
* 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.
78
75
* @returns The formatted fides_string
79
76
*/
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 ( ) ;
82
79
return window . Fides . options . tcfEnabled
83
80
? [ ...( window . Fides . fides_string ?. split ( FIDES_SEPARATOR ) || [ ] ) , "" , "" ]
84
81
. slice ( 0 , 2 )
85
- . concat ( gppString )
82
+ . concat ( gppString || "" )
86
83
. join ( FIDES_SEPARATOR )
87
- : `,,${ gppString } ` ;
84
+ : `,${ gppString ? ` ,${ gppString } ` : "" } ` ;
88
85
} ;
0 commit comments