Advanced Tutorials

Configurations override (API)

5min

IIn 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.

JS


Must be specified as an object:

JS


Inside, we can specify all the parameters we want to override, as in the example:

JS


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:

HTML


Param list

Below, you can check all the configuration parameters.


  1. acceptAllText: (string | null)
    • Description: Overrides the default text for the "Accept All" button in the user interface.
  2. 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).
  3. buttonBorderStyle: (ButtonBorderStyle | null)
    • Description: Overrides the default style of the button border.
  4. buttonShadow: (boolean | null)
    • Description: If true, removes the CSS box-shadow effect on buttons.
  5. buttonThickness: (ThicknessButtonType | null)
    • Description: Specifies the thickness of the buttons. Options: 0 (base), 1 (bold), 2 (medium).
  6. closeButton: (boolean | null)
    • Description: Enables advanced closure of the CMP through a "X" button at the top.
  7. closeButtonAcceptAllBehaviour: (boolean | null)
    • Description: If true, the "X" close button behaves as accepting all purposes.
  8. closeButtonBackgroundColor: (string | null)
    • Description: Overrides the background color of the close button.
  9. closeButtonBorder: (boolean | null)
    • Description: If true, displays a border around the close button.
  10. closeButtonBorderColor: (string | null)
    • Description: Overrides the border color of the close button.
  11. closeButtonColor: (string | null)
    • Description: Overrides the primary color specifically for the close button.
  12. closeButtonType: (CloseButtonType | null)
    • Description: Specifies the type of close button. Options: 0 ("X" button), 1 ("Close" button for GDPR), 2 (custom close with texts).
  13. closeText: (string | null)
    • Description: Overrides the default text for the close button.
  14. contentAlign: (UIAlignment | null)
    • Description: Specifies the alignment of the content inside the CMP.
  15. 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)
  16. debug: (boolean | null)
    • Description: Enables or disables the debug functionality of the CMP.
  17. differentiateButtons: (boolean | null)
    • Description: If true, every button in the footer will have different style.
  18. disableLegitimateMirror: (boolean | null)
    • Description: If true, the status of legal consents will not be reflected in the respective legitimate interests.
  19. disableProofOfConsent: (boolean | null)
    • Description: If true, the proof of consent endpoint will not be called.
  20. disableTracking: (boolean | null)
    • Description: If true, disables default CMP event tracking.
  21. disableVendorsAutomaticallyEnabling: (boolean | null)
    • Description: If true, vendors will not be enabled for auditing.
  22. expirationDaysForPartialConsents: (number | null)
    • Description: Sets the number of days before a partial consent expires and the CMP UI reappears.
  23. flatUIPosition: (FlatUIPosition | null)
    • Description: Changes the position when the CMP UI uses the Flat UI parameter.
  24. footerAlign: (UIAlignment | null)
    • Description: Specifies the footer alignment within the CMP.
  25. forceLimitedAdsAtLeast: (boolean | null)
    • Description: Logical parameter.
  26. hideMoreOptionsButton: (boolean | null)
    • Description: If true, hides the "More Options" button.
  27. isFlatUI: (boolean | null)
    • Description: If true, indicates use of the flat version of the UI.
  28. lockBodyScroll: (boolean | null)
    • Description: If true, blocks site scrolling when the CMP panel is shown.
  29. logoAlign: (UIAlignment | null)
    • Description: Specifies the logo alignment within the CMP.
  30. logoUrl: (string | null)
    • Description: Overrides the publisher's default logo URL.
  31. manageOptionsText: (string | null)
    • Description: Overrides the default text for handling options.
  32. openButton: (boolean | null)
    • Description: If true, show the button to reopen the CMP at the bottom.
  33. openButtonCTAColor: (string | null)
    • Description: Specifies the color of the text or symbol used in the open button.
  34. openButtonPosition: (OpenButtonPosition | null)
    • Description: Specifies the location of the open button (if enabled). Options: center, bottom.
  35. openButtonSide: (OpenButtonSide | null)
    • Description: Specifies the screen side for the open button (if enabled). Options: left, right.
  36. 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.
  37. 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.
  38. popupWallModeMessage: (string | null)
    • Description: Used when 'popupWallMode' is enabled to show a user a specific message under the title.
  39. popupWallModeRequireAcceptOfMandatoryCookies: (boolean | null)
    • Description: If true, requires acceptance of mandatory cookies when 'popupWallMode' is enabled.
  40. primaryColor: (string | null)
    • Description: Configures the primary color used by the CMP UI.
  41. purposesIdsThatMustBeEnabled: (number[] | null)
    • Description: Forces specific primary scope IDs to be true in all cases.
  42. secondaryColor: (string | null)
    • Description: Configures the secondary color used by the CMP UI.
  43. skipBot: (boolean | null)
    • Description: If true, the CMP will not skip the bot and will accept everything directly without rendering.
  44. skipRoutesConsentRequest: (string[] | null)
    • Description: Contains the paths where the CMP should be hidden.
  45. switchCloseBtnToRight: (boolean | null)
    • Description: If true, place the close button on the right and the back button on the left.
  46. titleAlign: (UIAlignment | null)
    • Description: Specifies the title alignment within the CMP.
  47. uiBorderStyle: (UIBorderStyle | null)
    • Description: Overrides the default UI border style.
  48. 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.
  49. cookieWallModeEnabled: (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.
  50. cookieWallModeLoginPage: (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.
  51. cookieWallModeOptOutCookieName: (string | null)
    • Description: Required field used to exclude the CMP UI from being rendered to the user when cookie wall mode is enabled.
  52. cookieWallModeSkipRoutesConsentRequest: (string[] | null)
    • Description: Paths where the CMP should skip the consent request when cookie wall mode is enabled.
  53. cookieWallModeSubscriptionPageLink: (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.

HTML