Advanced Tutorials
Configurations override (API)
5min
i in the context of cmp usage, it may be necessary to modify cmp configurations through custom logic within your website to enable this, we introduce the ability to specify configurations through the global configuration override variable for the pubconsent cmp currently, this override is only possible in standard web integrations and not in amp integrations, where it's available only if enabled the consent sharing amp < > web standard docid 6qydrw51vsp1dwrybv zx window pub tech override cmp config must be specified as an object window pub tech override cmp config = { 	// } inside, 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 '', // se the list below } it's 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 param 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 adaptivefont (boolean | null) description if set to true, the font of the consent management platform (cmp) will use the default font of the website (check your website's css) buttonborderstyle (buttonborderstyle | null) description overrides the default style of the button border buttonshadow (boolean | null) description if true, removes the css box shadow effect on buttons buttonthickness (thicknessbuttontype | null) description specifies the thickness of the buttons options 0 (base), 1 (bold), 2 (medium) closebutton (boolean | null) description enables advanced closure of the cmp through a "x" button at the top closebuttonacceptallbehaviour (boolean | null) description if true, the "x" close button behaves as accepting all purposes 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 (custom close with texts) closetext (string | null) description overrides the default text for the close button contentalign (uialignment | null) description specifies the alignment of the content inside the cmp custommessage (string | null) description replaces the default message in the main panel of the cmp with a custom message html format is supported within the custom text, html can be inserted within the html, a link to the vendor list can be specified using an element with the 'partners shortcut' class; the cmp will automatically enable clicking to open the vendor list 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 debug functionality of the cmp differentiatebuttons (boolean | null) description if true, every button in the footer will have different style disablelegitimatemirror (boolean | null) description if true, the status of legal consents will not be reflected in the respective legitimate interests disableproofofconsent (boolean | null) description if true, the proof of consent endpoint will not be called disabletracking (boolean | null) description if true, disables default cmp event tracking disablevendorsautomaticallyenabling (boolean | null) description if true, vendors will not be enabled for auditing 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 footeralign (uialignment | null) description specifies the footer alignment within the cmp forcelimitedadsatleast (boolean | null) description logical parameter hidemoreoptionsbutton (boolean | null) description if true, hides the "more options" button isflatui (boolean | null) description if true, indicates use of the flat version of the ui lockbodyscroll (boolean | null) description if true, blocks site scrolling when the cmp panel is shown logoalign (uialignment | null) description specifies the logo alignment within the cmp logourl (string | null) description overrides the publisher's default logo url manageoptionstext (string | null) description overrides the default text for handling options openbutton (boolean | null) description if true, show 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 location of the open button (if enabled) options center, bottom openbuttonside (openbuttonside | null) description specifies the screen side for the open button (if enabled) options left, right cookiename (string | null) description changes the name of the cookie used to save the tc string warning changing the cookie name does not delete the old cookie popupwallmodeenabled (boolean | null) description if true, show a popup after the user clicks the decline 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 under the title popupwallmoderequireacceptofmandatorycookies (boolean | null) description if true, requires acceptance of mandatory cookies when 'popupwallmode' is enabled primarycolor (string | null) description configures the primary color used by the cmp ui purposesidsthatmustbeenabled (number\[] | null) description forces specific primary scope ids to be true in all cases secondarycolor (string | null) description configures the secondary color used by the cmp ui skipbot (boolean | null) description if true, the cmp will not skip the bot and will accept everything directly without rendering skiproutesconsentrequest (string\[] | null) description contains the paths where the cmp should be hidden switchclosebtntoright (boolean | null) description if true, place the close button on the right and the back button on the left titlealign (uialignment | null) description specifies the title alignment within the cmp uiborderstyle (uiborderstyle | null) description overrides the default ui border style usecompactacstringascookie (boolean | null) description if true, store ac string in compact mode in cookie instead of localstorage it must be true if the publisher needs sharing consent cookiewallmode (boolean | null) description if true, enables plan mode, preventing refusal of consent by forcing the user to accept everything or sign up for a subscription cookiewallmodeloginlink (string | null) description required field used in the ui to create a button that redirects users to the login page when cookie wall mode is enabled cookiewallmodeoptoutcookiename (string | null) description required field used to exclude the cmp ui from being rendered to the user 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 cookiewallmodesubscriptionlink (string | null) description required field used in the ui to create a button that redirects users to the plan (subscription) page when cookie wall mode is enabled (1) example link to privacy policy privacy url