|
| 1 | +window.addEventListener('load', function() { |
| 2 | + const cc = initCookieConsent(); |
| 3 | + |
| 4 | + cc.run({ |
| 5 | + current_lang: 'en', |
| 6 | + autoclear_cookies: true, |
| 7 | + page_scripts: true, |
| 8 | + force_consent: true, |
| 9 | + |
| 10 | + onFirstAction: function(user_preferences, cookie) { |
| 11 | + // callback triggered only once on the first accept/reject action |
| 12 | + location.reload(); |
| 13 | + }, |
| 14 | + onAccept: function () { |
| 15 | + if (cc.allowedCategory('analytics')) { |
| 16 | + gtag('consent', 'update', { |
| 17 | + 'analytics_storage': 'granted' |
| 18 | + }); |
| 19 | + document.cookie = "cc_analytics=1"; |
| 20 | + } else { |
| 21 | + document.cookie = "cc_analytics=0"; |
| 22 | + } |
| 23 | + |
| 24 | + if (cc.allowedCategory('targeting')) { |
| 25 | + gtag('consent', 'update', { |
| 26 | + 'ad_storage': 'granted' |
| 27 | + }); |
| 28 | + document.cookie = "cc_targeting=1"; |
| 29 | + } else { |
| 30 | + document.cookie = "cc_targeting=0"; |
| 31 | + } |
| 32 | + }, |
| 33 | + onChange: function (cookie, changed_categories) { |
| 34 | + // callback triggered when user changes preferences after consent has already been given |
| 35 | + location.reload(); |
| 36 | + }, |
| 37 | + |
| 38 | + gui_options: { |
| 39 | + consent_modal: { |
| 40 | + layout: 'box', // box/cloud/bar |
| 41 | + position: 'middle center', // bottom/middle/top + left/right/center |
| 42 | + transition: 'zoom', // zoom/slide |
| 43 | + }, |
| 44 | + settings_modal: { |
| 45 | + transition: 'zoom' // zoom/slide |
| 46 | + } |
| 47 | + }, |
| 48 | + |
| 49 | + languages: { |
| 50 | + 'en': { |
| 51 | + consent_modal: { |
| 52 | + title: 'Mmmm Cookies...', |
| 53 | + description: "Hypernode Docs uses cookies from Google to analyze activities on our website and to improve our documentation.<br><br>Read more about cookies in our <a href='https://www.hypernode.com/cookie-policy/' target='_blank' rel='noopener'>cookie policy</a> or take a look at our <a href='https://www.hypernode.com/privacy-policy/' target='_blank' rel='noopener'>privacy policy</a> to see how carefully we handle your personal data. If desired, you can change your preferences under ‘Preferences’.", |
| 54 | + primary_btn: { |
| 55 | + text: 'Accept all', |
| 56 | + role: 'accept_all' |
| 57 | + }, |
| 58 | + secondary_btn: { |
| 59 | + text: 'Preferences', |
| 60 | + role: 'settings' |
| 61 | + } |
| 62 | + }, |
| 63 | + settings_modal: { |
| 64 | + title: 'Mmmm Cookies...', |
| 65 | + save_settings_btn: 'Save preferences', |
| 66 | + accept_all_btn: 'Accept all', |
| 67 | + blocks: [ |
| 68 | + { |
| 69 | + title: 'Functional', |
| 70 | + description: 'The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.', |
| 71 | + toggle: { |
| 72 | + value: 'necessary', |
| 73 | + enabled: true, |
| 74 | + readonly: true // cookie categories with readonly=true are all treated as "necessary cookies" |
| 75 | + } |
| 76 | + }, { |
| 77 | + title: 'Statistics', |
| 78 | + description: 'The technical storage or access that is used exclusively for statistical purposes.', |
| 79 | + toggle: { |
| 80 | + value: 'analytics', |
| 81 | + enabled: false, |
| 82 | + readonly: false |
| 83 | + }, |
| 84 | + }, { |
| 85 | + title: 'Marketing', |
| 86 | + description: 'The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.', |
| 87 | + toggle: { |
| 88 | + value: 'targeting', |
| 89 | + enabled: false, |
| 90 | + readonly: false |
| 91 | + } |
| 92 | + } |
| 93 | + ] |
| 94 | + } |
| 95 | + } |
| 96 | + } |
| 97 | + }); |
| 98 | +}); |
0 commit comments