Skip to content

Commit

Permalink
issue#669 ajout de tarteaucitoronjs
Browse files Browse the repository at this point in the history
  • Loading branch information
stakovicz committed Jan 4, 2025
1 parent 33880df commit 1fef5e3
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/Resources/views/google_analytics.html.twig
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ google_analytics_id }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
<script src="{{ asset('/assets/tarteaucitron/tarteaucitron.js') }}"></script>
<script src="{{ asset('/js/tarteaucitron.js') }}"></script>

gtag('config', '{{ google_analytics_id }}');
<script type="text/javascript">
tarteaucitron.user.gtagUa = '{{ google_analytics_id }}';
// tarteaucitron.user.gtagCrossdomain = ['example.com', 'example2.com'];
tarteaucitron.user.gtagMore = function () { /* add here your optionnal gtag() */ };
(tarteaucitron.job = tarteaucitron.job || []).push('gtag');
</script>
51 changes: 51 additions & 0 deletions htdocs/js/tarteaucitron.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

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": "bottom", /* Banner position (top - bottom) */

"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 */
"cookieslist": false, /* Show the cookie list */

"closePopup": false, /* Show a close X on the banner */

"showIcon": true, /* Show cookie icon to manage cookies */
//"iconSrc": "", /* Optionnal: URL or base64 encoded image */
"iconPosition": "BottomRight", /* 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": true, /* If Do Not Track == 1, disallow all */

"removeCredit": true, /* 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.js file will be loaded */

//"cookieDomain": ".my-multisite-domaine.fr", /* Shared cookie for multisite */

"readmoreLink": "", /* Change the default readmore link */

"mandatory": true, /* Show a message about mandatory cookies */
"mandatoryCta": true, /* Show the disabled accept button when mandatory on */

//"customCloserId": "", /* Optional a11y: Custom element ID used to open the panel */

"googleConsentMode": true, /* Enable Google Consent Mode v2 for Google ads and GA4 */

"partnersList": false /* Show the number of partners on the popup/middle banner */
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"tablefilter": "^0.5.42",
"tarteaucitronjs": "^1.19.0",
"webpack": "^3.6.0"
},
"scripts": {
Expand Down
5 changes: 5 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ const adminConfig = {
{ from: path.resolve(__dirname, 'node_modules/notyf/dist/'), to: path.resolve(__dirname, 'htdocs/assets/techletter/') },
{ from: path.resolve(__dirname, 'node_modules/qr-scanner/qr-scanner.min.js'), to: path.resolve(__dirname, 'htdocs/assets/qr-scanner/qr-scanner.min.js') },
{ from: path.resolve(__dirname, 'node_modules/qr-scanner/qr-scanner-worker.min.js'), to: path.resolve(__dirname, 'htdocs/assets/qr-scanner/qr-scanner-worker.min.js') },
{ from: path.resolve(__dirname, 'node_modules/tarteaucitronjs/tarteaucitron.js'), to: path.resolve(__dirname, 'htdocs/assets/tarteaucitron/tarteaucitron.js') },
{ from: path.resolve(__dirname, 'node_modules/tarteaucitronjs/advertising.js'), to: path.resolve(__dirname, 'htdocs/assets/tarteaucitron/advertising.js') },
{ from: path.resolve(__dirname, 'node_modules/tarteaucitronjs/tarteaucitron.services.js'), to: path.resolve(__dirname, 'htdocs/assets/tarteaucitron/tarteaucitron.services.js') },
{ from: path.resolve(__dirname, 'node_modules/tarteaucitronjs/css/tarteaucitron.css'), to: path.resolve(__dirname, 'htdocs/assets/tarteaucitron/css/tarteaucitron.css') },
{ from: path.resolve(__dirname, 'node_modules/tarteaucitronjs/lang/tarteaucitron.fr.js'), to: path.resolve(__dirname, 'htdocs/assets/tarteaucitron/lang/tarteaucitron.fr.js') },
])
],
module: {
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4825,6 +4825,11 @@ tar@^2.0.0, tar@^2.2.1:
fstream "^1.0.2"
inherits "2"

tarteaucitronjs@^1.19.0:
version "1.19.0"
resolved "https://registry.yarnpkg.com/tarteaucitronjs/-/tarteaucitronjs-1.19.0.tgz#e6068afa9df2aacae884ea20ecb84721d7bd8c28"
integrity sha512-UGk0EY1//N/cEcs1hhxE627/7i2uLnbuzJNVmwh097d1u376Qbmz41Qwb3Of3JI97QTRsH5+K2BNU39WjsuSOQ==

timers-browserify@^2.0.4:
version "2.0.6"
resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.6.tgz#241e76927d9ca05f4d959819022f5b3664b64bae"
Expand Down

0 comments on commit 1fef5e3

Please sign in to comment.