Advanced Tutorials
Configurations override (API)
3 min
depending on the use case of the cmp, it may be necessary to modify the cmp configurations through custom logic within your site for this reason, it is necessary to introduce the possibility of specifying the configurations through the global override variable for pubconsent cmp currently, this override is only possible in standard web integrations and not in amp, where it is only available if consent sharing is enabled ( docid 6qydrw51vsp1dwrybv zx ) within the window pub tech override cmp config variable, we can specify all the parameters we want to override, as in the example window pub tech override cmp config = { policyurl 'https //www yourwebsite com/privacy policy/', logourl 'https //www yourwebsite com/img/logo png', primarycolor '#c66653', secondarycolor '', closebuttoncolor '', //see the table for all parameters } it is important that this variable is specified before the cmp is executed for this reason, we recommend specifying this variable before the cmp integration script tag as shown in the example below configuration parameters list below you can check all the configuration parameters acceptalltext (string | null) description overrides the default text for the "accept all" button in the user interface additionalrefreshconsentonpcupdates (boolean | null) description logic parameter if true , when a new version of the configured cookies is detected, the cmp will request consent from users adaptivefont (boolean | null) description if set to true , the consent management platform (cmp) font will use the website's default font (check your website's css) advancedclose (boolean | null) description enables advanced closing of the cmp via an "x" button at the top it is the publisher's responsibility to enable this function affirmativebuttonicon (buttoniconstyle) description values 1 and 2 add an icon to the "accept all" button possible values 0 (none), 1 (arrow), 2 (checkmark) buttonborderstyle (buttonborderstyle | null) description overrides the default button border style options 0 (rectangular), 1 (rounded) buttonshadow (boolean | null) description if true , removes the box shadow css effect on buttons buttonthickness (thicknessbuttontype | null) description specifies the thickness of the buttons options 0 (base), 1 (fat), 2 (medium) closebuttonbackgroundcolor (string | null) description overrides the background color of the close button closebuttonborder (boolean | null) description if true , displays a border around the close button closebuttonbordercolor (string | null) description overrides the border color of the close button closebuttoncolor (string | null) description overrides the primary color specifically for the close button closebuttontype (closebuttontype | null) description specifies the type of close button options 0 ("x" button), 1 ("close" button for gdpr), 2 (customized close with texts) closetext (string | null) description overrides the default text for the close button compactfirstlayer (boolean | undefined) description makes the first layer a compact user interface available in the standard layout contentalign (alignment | null) description specifies the content alignment within the cmp options 0 (left), 1 (center), 2 (right) cookiewallmode (boolean | null) description if true , enables the plan mode, preventing the refusal of consent by forcing the user to accept everything or subscribe cookiewallmodedenypersistence (boolean | null) description logic parameter only if hooksusage is true and it is explicitly communicated to the customer that the onwasrejected hooks must be configured cookiewallmodehooksusage (boolean | null) description logic parameter enables the cmp to use the cookie wall hooks to allow customer developers to implement an advanced integration of the cookie wall mode on their websites ( docid\ vda emgbbqjzyx9og2duv ) cookiewallmodeloginlink (string | null) description mandatory field used in the ui to create a button that redirects users to the login page when cookie wall mode is enabled cookiewallmodenoconsentroutes (string\[] | null) description paths where the cmp should skip the consent request when cookie wall mode is enabled cookiewallmodeoptoutcookiename (string | null) description mandatory field used to exclude the rendering of the cmp ui for the user when cookie wall mode is enabled cookiewallmodesubscriptionlink (string | null) description mandatory field used in the ui to create a button that redirects users to the plan (subscription) page when cookie wall mode is enabled custommessage (string | null) description replaces the default message in the main cmp panel with a custom message html format is supported within the custom text, it is possible to insert html within the html, you can specify a link to the vendor list via an element with the 'partners shortcut' class; the cmp will automatically make it possible to open the vendor list on click for the privacy policy link, we recommend adding the link as in the example at the bottom of the page (1) debug (boolean | null) description enables or disables the cmp's debug functionality delegateconsentpersist (boolean | null) description logic parameter if true , the cmp delegates consent persistence to the publisher's code; if false or null (default), the cmp handles persistence internally differentiatebuttons (boolean | null) description if true , the primary color is used in the accept button disablelegitimatemirror (boolean | null) description if true , the status of legal consents will not be reflected on the respective legitimate interests disablevendorsautomaticallyenabling (boolean | null) description if true , vendors will not be enabled for checking discloseconsentafterprerender (boolean | undefined) description logic parameter if true , consent will be disclosed only after the browser's prerendering phase expandtoviewport (boolean | undefined) description if true , the cmp will expand to the viewport size (height and full screen on mobile) expirationdaysforpartialconsents (number | null) description sets the number of days before a partial consent expires and the cmp ui reappears flatuiposition (flatuiposition | null) description changes the position when the cmp ui uses the flat ui parameter options 'top', 'bottom' footeralign (alignment | null) description specifies the footer alignment within the cmp options 0 (left), 1 (center), 2 (right) googleconsentmodedebug (boolean) description logic parameter used to debug the google consent mode integration by viewing the browser console logs googleconsentmodewebtcfflag (boolean) description if the user cannot use the gtm template or gtag integration, they can enable this option, and google tag will directly read the tcf consent to know the consent mode status headeractionstobottom (boolean | undefined) description tries to move the actions available in the header section of the ui to the bottom, close to the content available in the standard layout hidelogincta (boolean | null) description logic parameter if true , the cmp will not show the login button in the ui hidemoreoptionsbutton (boolean | null) description if true , hides the "more options" button isflatui (boolean | null) description if true , indicates the use of the flat version of the ui islegitimateinterestenabled (boolean | null) description logic parameter if true , legitimate interests will be enabled lockbodyscroll (boolean | null) description if true , blocks site scrolling when the cmp panel is shown logoalign (alignment | null) description specifies the logo alignment within the cmp options 0 (left), 1 (center), 2 (right) logoheight (number | null) description logo height in px logourl (string | null) description overrides the publisher's default logo url manageoptionstext (string | null) description overrides the default text for managing options narrowgooglevendorids (number\[] | null) description logic parameter this allows narrowing the google vendors used narrowtcfvendorids (number\[] | null) description logic parameter this allows narrowing the tcf vendors used openbutton (boolean | null) description if true , shows the button to reopen the cmp at the bottom openbuttonctacolor (string | null) description specifies the color of the text or symbol used in the open button openbuttonposition (openbuttonposition | null) description specifies the position of the open button (if enabled) options 'middle', 'bottom' openbuttonside (openbuttonside | null) description specifies the side of the screen for the open button (if enabled) options 'left', 'right' permitlegitimateinterestonlyforcriticalvendors (boolean) description logic parameter this allows the cmp to enable legitimate interest only for critical tcf vendors that cannot be enabled otherwise policyurl (string) description url of the publisher's privacy policy popupwallmodeenabled (boolean | null) description if true , shows a popup after the user clicks the reject button to force an action behaviors differ based on the 'cookiewallmodeenabled' flag popupwallmodemessage (string | null) description used when 'popupwallmode' is enabled to show a user a specific message below the title popupwallmoderequireacceptofmandatorycookies (boolean | null) description if true , requires the acceptance of mandatory cookies when 'popupwallmode' is enabled popupwalltitle (string | null) description to override the default title shown when the popup wall is shown to the end user primarycolor (string | null) description configures the primary color used by the cmp ui purposesidsthatmustbeenabled (number\[] | null) description forces specific primary purpose ids to be true in all cases secondarycolor (string | null) description configures the secondary color used by the cmp ui secondarytextcolor (string | null) description configures the secondary text colors used by the cmp ui skipbot (boolean | null) description if true , the cmp will not skip the bot and will accept all directly without rendering skiproutesconsentrequest (string\[] | null) description contains the paths where the cmp must be hidden stackfooteractions (boolean | undefined) description if true , the footer actions will be stacked one on top of the other switchclosebtntoright (boolean | null) description if true , positions the close button on the right and the back button on the left title (string | null) description overrides the default title when the cmp ui banner appears titlealign (alignment | null) description specifies the title alignment within the cmp options 0 (left), 1 (center), 2 (right) uiborderstyle (uiborderstyle | null) description overrides the default ui border style options 0 (rectangular), 1 (rounded) uppercaseforactions (boolean | undefined) description if true , the button text will be uppercase usecompactacstringascookie (boolean | null) description if true , stores the ac string in compact mode in the cookie instead of localstorage must be true if the publisher needs consent sharing (see docid 6qydrw51vsp1dwrybv zx ) (1) example privacy policy link privacy url