Manual configuration override
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 (Consent Sharing: AMP <-> Web Standard ).
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:
<head>
<script>
window.__pub_tech_override_cmp_config = {
policyUrl: 'https://www.yourwebsite.com/privacy-policy/',
logoUrl: 'https://www.yourwebsite.com/img/logo.png',
primaryColor: '#c66653',
}
</script>
<!-- PubConsent integration code from the configurator -->
</head>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. (Cookie Wall mode)
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 Consent Sharing: AMP <-> Web Standard ).
(1) Example privacy policy link.
<a rel="nofollow noopener noreferrer" href="here the link to the policy" target="_blank">privacy url</a>