codingdavinci / relaunch2018

This is the new Coding da Vinci website (online since September 2020).
https://codingdavinci.de
GNU General Public License v2.0
1 stars 1 forks source link

eu_cookie_compliance errors after accept cookies 🍪 #256

Closed mbuechner closed 4 years ago

mbuechner commented 4 years ago

After I agreed to accept cookies I am getting these errors at the console. Why?

(index):1 GET https://test.codingdavinci.de/%2520%2520_paq.push%2528%255B%2527trackPageView%2527%255D%2529%253B net::ERR_ABORTED 404
euCookieComplianceLoadScripts @ (index):1
o.eu_cookie_compliance.acceptAction @ eu_cookie_compliance.min.js?v=1:15
dispatch @ jquery.min.min.js?v=3.5.1:14
h.handle @ jquery.min.min.js?v=3.5.1:13
(index):1 GET https://test.codingdavinci.de/if%2520%2528%2521Drupal.eu_cookie_compliance.hasAgreed%2528%2529%2529%257B net::ERR_ABORTED 404
euCookieComplianceLoadScripts @ (index):1
o.eu_cookie_compliance.acceptAction @ eu_cookie_compliance.min.js?v=1:15
dispatch @ jquery.min.min.js?v=3.5.1:14
h.handle @ jquery.min.min.js?v=3.5.1:13
(index):1 GET https://test.codingdavinci.de/%2520%2520_paq.push%2528%255B%2527disableCookies%2527%255D%2529%253B net::ERR_ABORTED 404
euCookieComplianceLoadScripts @ (index):1
o.eu_cookie_compliance.acceptAction @ eu_cookie_compliance.min.js?v=1:15
dispatch @ jquery.min.min.js?v=3.5.1:14
h.handle @ jquery.min.min.js?v=3.5.1:13
(index):1 GET https://test.codingdavinci.de/%257D net::ERR_ABORTED 404
Snater commented 4 years ago

There's some strange setup of the EU Compliance Cookie which cannot work like that—I don't think that's something I did, anyway: On /admin/config/system/eu-cookie-compliance, the box to link JavaScript files contains actual JavaScript code, so each line there triggers a request to load a JS file… The code should instead be in the Matomo module config at /admin/config/system/matomo (ERWEITERTE EINSTELLUNGEN > BENUTZERDEFINIERTER JAVASCRIPT-CODE > Codeausschnitt (vorher)), but I also doubt the code should be like that. It should just be

if (!Drupal.eu_cookie_compliance.hasAgreed()){
  _paq.push(['disableCookies']);
}

Completely disabling tracking when disabling Cookies does not work like it was tried to be configured, and I don't think both concepts should be mixed. And I am not sure it is actually possible because _paq.push(["trackPageView"]) is triggered in any way by the Matomo module, either with a Cookies being set by Matomo or not.

I have removed the code from the EU Cookie Compliance module config. Saving the Matomo config fails on the configured HTTP URLs (https://report-t.codingdavinci.de/) with

Die Validierung von „http://report-t.codingdavinci.de/matomo.php“ ist mit der Ausnahme „cURL error 28: Connection timed out after 30001 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)“ (HTTP-Code 0) fehlgeschlagen.
mbuechner commented 4 years ago

Saving the Matomo config fails on the configured HTTP URLs (https://report-t.codingdavinci.de/) with ...

I configured the internal URL http://matomoapp/ (no HTTPS available) and seems to work...!?

mbuechner commented 4 years ago

I configured the internal URL http://matomoapp/ (no HTTPS available) and seems to work...!?

Nope, that's not the solution. I forwarded the problem to DNB IT...

lucyWMDE commented 4 years ago

@mbuechner any news? If there's anything @Snater should do here this weekend is likely one of the last chances...

Snater commented 4 years ago

I was able to add the script to the Matomo module config. Matomo should not set a Cookie now if the Cookie agreement was not agreed to.

lucyWMDE commented 4 years ago

@mbuechner problem solved?

mbuechner commented 4 years ago

It's solved, I think! 👍