Skip to content

Instantly share code, notes, and snippets.

@annelyse
Last active February 3, 2023 14:27
Show Gist options
  • Save annelyse/13ed039ff1e0e2c84cf057bd041ddf64 to your computer and use it in GitHub Desktop.
Save annelyse/13ed039ff1e0e2c84cf057bd041ddf64 to your computer and use it in GitHub Desktop.
//---------------------------//
// TARTE AU CITRON - COOKIES
//---------------------------//
const tarteaucitron = window.tarteaucitron;
if (tarteaucitron) {
let locale = document.documentElement.lang;
locale = locale.substring(0, 2);
const tarteaucitronForceLanguage = locale;
let privacyLink = document.getElementsByClassName("link_privacy_js");
if (privacyLink.length > 0) {
privacyLink = privacyLink[0].getElementsByTagName("a");
privacyLink = privacyLink[0].getAttribute("href");
} else {
privacyLink = "/mentions-legales";
}
tarteaucitron.init({
privacyUrl: privacyLink,
/* Privacy policy url */
hashtag: "#tarteaucitron",
/* Open the panel with this hashtag */
cookieName: "tarteaucitron",
/* Cookie name */
orientation: "middle",
/* Banner position (top - bottom) */
showAlertSmall: false, // sans le titre
groupServices: false,
/* Group services by category */
/* Show the small banner on bottom right */
cookieslist: true,
/* Show the cookie list */
adblocker: false,
/* Show a Warning if an adblocker is detected */
AcceptAllCta: true,
/* Show the accept all button when highPrivacy on */
highPrivacy: true,
/* Disable auto consent */
handleBrowserDNTRequest: false,
/* If Do Not Track == 1, accept all */
removeCredit: true,
/* Remove credit link */
moreInfoLink: false,
/* Show more info link */
DenyAllCta: true,
mandatory: true,
showIcon: false,
closePopup: false,
useExternalCss: true /* If false, the tarteaucitron.css file will be loaded */,
useExternalJs: false, //When you use useExternalJs as true you have to load the services.js and lang.js files by yourself.
//"cookieDomain": ".my-multisite-domaine.fr" /* Shared cookie for subdomain */
});
// tarteaucitron.initEvents.loadEvent(true);
tarteaucitron.user.googlemapsKey = ""; //change google map api
tarteaucitron.user.mapscallback = "initMapsCookiesAllows";
(tarteaucitron.job = tarteaucitron.job || []).push("googlemaps");
tarteaucitron.user.gajsUa = "UA-";
tarteaucitron.user.gajsMore = function () {
/* add here your optionnal _ga.push() */
};
(tarteaucitron.job = tarteaucitron.job || []).push("gajs");
// tarteaucitron.user.googletagmanagerId = '';
// (tarteaucitron.job = tarteaucitron.job || []).push('googletagmanager');
(tarteaucitron.job = tarteaucitron.job || []).push("youtube");
(tarteaucitron.job = tarteaucitron.job || []).push("vimeo");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment