{"id":5893,"date":"2024-03-11T19:56:14","date_gmt":"2024-03-11T18:56:14","guid":{"rendered":"https:\/\/ekiwi.de\/?p=5893"},"modified":"2024-03-11T19:56:14","modified_gmt":"2024-03-11T18:56:14","slug":"cookieconsent-v3-probleme-beim-script-management-mit-data-category","status":"publish","type":"post","link":"https:\/\/ekiwi.de\/index.php\/5893\/cookieconsent-v3-probleme-beim-script-management-mit-data-category\/","title":{"rendered":"CookieConsent v3: Probleme beim Script Management mit data-category"},"content":{"rendered":"<p>Scripte wurden nicht ausgef\u00fchrt, bei Auswahl der Cookie-Kategorie.<\/p>\n<p><!--more--><\/p>\n<p>Auf zwei unserer Webseiten habe ich mit Hilfe des &#8222;<a href=\"https:\/\/github.com\/orestbida\/cookieconsent\">CookieConsent-Scriptes<\/a>&#8220; einem Cookie-Banner gebaut.<\/p>\n<p>Je nach Auswahl der Kategorien sollen bestimmte <a href=\"https:\/\/cookieconsent.orestbida.com\/advanced\/manage-scripts.html\">Scripte ausgef\u00fchrt werden<\/a>, z.B. f\u00fcr Matomo oder Google Analytics. <\/p>\n<p>Allerdings funktionierte dies nicht. Ich habe die Scripte zwar mit dem &#8222;data-category&#8220; Attribut ausgezeichnet und auch den &#8222;type&#8220; auf &#8222;text\/plain&#8220; gesetzt, aber die Auswahl wurde nicht erkannt bzw. das Script nicht ausgef\u00fchrt.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2024\/03\/cookie_1.png\" alt=\"\" width=\"527\" height=\"142\" class=\"alignnone size-full wp-image-5894\" srcset=\"\/wp-content\/uploads\/2024\/03\/cookie_1.png 527w, \/wp-content\/uploads\/2024\/03\/cookie_1-300x81.png 300w\" sizes=\"auto, (max-width: 527px) 100vw, 527px\" \/><\/p>\n<p>Die L\u00f6sung war am Ende recht einfach. Wichtig ist, dass das Konfigurationsscript bzw. das Cookie-Consent-Script erst am Ende bzw. nach den Scripten ausgef\u00fchrt wird. Anschlie\u00dfend klappte es.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2024\/03\/cookie_2.png\" alt=\"\" width=\"643\" height=\"165\" class=\"alignnone size-full wp-image-5896\" srcset=\"\/wp-content\/uploads\/2024\/03\/cookie_2.png 643w, \/wp-content\/uploads\/2024\/03\/cookie_2-300x77.png 300w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/p>","protected":false},"excerpt":{"rendered":"<p>Scripte wurden nicht ausgef\u00fchrt, bei Auswahl der Cookie-Kategorie.<\/p>\n","protected":false},"author":1,"featured_media":2416,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[15,13],"tags":[207,68],"class_list":["post-5893","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","category-programmierung","tag-cookie","tag-datenschutz"],"_links":{"self":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts\/5893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/comments?post=5893"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts\/5893\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/media\/2416"}],"wp:attachment":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/media?parent=5893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/categories?post=5893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/tags?post=5893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}