Initialize tarteaucitron.js
masterTo use tarteaucitron.js, include the script in your HTML and call tarteaucitron.init() with a configuration object. The script manages GDPR compliance by disabling services by default, displaying a consent banner, and storing consent in a cookie for 365 days.
<script src="/tarteaucitron/tarteaucitron.js"></script>
<script>
tarteaucitron.init({
"privacyUrl": "", /* Privacy policy url */
"bodyPosition": "bottom", /* or top to bring it as first element for accessibility */
"hashtag": "#tarteaucitron", /* Open the panel with this hashtag */
"cookieName": "tarteaucitron", /* Cookie name */
"orientation": "middle", /* Banner position (top - bottom - middle - popup) */
"groupServices": false, /* Group services by category */
"showDetailsOnClick": true, /* Click to expand the description */
"serviceDefaultState": "wait", /* Default state (true - wait - false) */
"showAlertSmall": false, /* Show the small banner on bottom right */
"showTitleBanner": false, /* Also show the title (middleBarHead) on the top/bottom banners */
"cookieslist": false, /* Show the cookie list in a mini banner */
"cookieslistEmbed": false, /* Show the cookie list on the control panel */
"showIcon": true, /* Show cookie icon to manage cookies */
"iconPosition": "BottomRight", /* Position of the icon between BottomRight, BottomLeft, TopRight and TopLeft */
"adblocker": false, /* Show a Warning if an adblocker is detected */
"DenyAllCta" : true, /* Show the deny all button */
"AcceptAllCta" : true, /* Show the accept all button when highPrivacy on */
"highPrivacy": true, /* HIGHLY RECOMMANDED Disable auto consent */
"alwaysNeedConsent": false, /* Ask the consent for "Privacy by design" services */
"handleBrowserDNTRequest": false, /* If Do Not Track == 1, disallow all */
"removeCredit": false, /* Remove credit link */
"moreInfoLink": true, /* Show more info link */
"useExternalCss": false, /* If false, the tarteaucitron.css file will be loaded */
"useExternalJs": false, /* If false, the tarteaucitron.services.js file and lang files will be loaded */
"readmoreLink": "", /* Change the default readmore link pointing to tarteaucitron.io */
"mandatory": true, /* Show a message about mandatory cookies */
"mandatoryCta": true, /* Show the disabled accept button when mandatory on */
"googleConsentMode": true, /* Enable Google Consent Mode v2 for Google ads and GA4 */
"bingConsentMode": true, /* Enable Bing Consent Mode for Clarity and Bing Ads */
"pianoConsentMode": true, /* Enable Piano Analytics Consent Mode */
"pianoConsentModeEssential": false, /* Load in Essential mode instead of opt-out by default */
"softConsentMode": false, /* Soft consent mode (consent is required to load the services) */
"dataLayer": false, /* Send an event to dataLayer with the services status */
"serverSide": false, /* Server side only, tags are not loaded client side */
"partnersList": false /* Details the number of partners on the popup and middle banner */
});
</script>