PageSourceSearch

https://www.north-herts.gov.uk/profiles/contrib/council_platform/m…/cp_cookie_compliance.js?tiknwg

js north-herts.gov.uk collected 2026-09-24 18:45:25 UTC 2,112 bytes, 50 lines download raw bytes

1(function (Drupal, drupalSettings, $) {
2
3  if (typeof _paq !== 'undefined' && Array.isArray(_paq)) {
4    // Require consent for Matomo
5    // This should be set when configuring the module.
6    _paq.push(['requireCookieConsent']);
7
8    var $document = $(document);
9
10    $document.ready(function () {
11
12      if (Drupal.eu_cookie_compliance && Drupal.eu_cookie_compliance.hasAgreed()) {
13        // Consent has been given.
14        _paq.push(['setCookieConsentGiven']);
15      }
16    });
17
18    /** Possible eu_cookie_compliance statuses:
19     *  null: not yet agreed (or withdrawn), show popup
20     *  0: Disagreed
21     *  1: Agreed, show thank you banner
22     *  2: Agreed
23     */
24    var cookieValueRevoked = null;
25    var cookieValueDisagreed = (typeof drupalSettings.eu_cookie_compliance.cookie_value_disagreed === 'undefined' || drupalSettings.eu_cookie_compliance.cookie_value_disagreed === '') ? '0' : drupalSettings.eu_cookie_compliance.cookie_value_disagreed;
26    var cookieValueAgreedShowThankYou = (typeof drupalSettings.eu_cookie_compliance.cookie_value_agreed_show_thank_you === 'undefined' || drupalSettings.eu_cookie_compliance.cookie_value_agreed_show_thank_you === '') ? '1' : drupalSettings.eu_cookie_compliance.cookie_value_agreed_show_thank_you;
27    var cookieValueAgreed = (typeof drupalSettings.eu_cookie_compliance.cookie_value_agreed === 'undefined' || drupalSettings.eu_cookie_compliance.cookie_value_agreed === '') ? '2' : drupalSettings.eu_cookie_compliance.cookie_value_agreed;
28
29    $document.on('eu_cookie_compliance.changeStatus', function(event, status) {
30
31      switch(status) {
32        case cookieValueRevoked:
33        case cookieValueDisagreed:
34          // Disagreed or Revoked.
35          _paq.push(['forgetCookieConsentGiven']);
36          break;
37        case cookieValueAgreedShowThankYou:
38        case cookieValueAgreed:
39          // Agreed.
40          _paq.push(['rememberCookieConsentGiven']);
41          break;
42        default:
43          console.error('CP Cookie Compliance: EU Cookie Compliance status unknown', status);
44      }
45
46    });
47
48  }
49
50})(Drupal, drupalSettings, jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.