<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Stefan Fiedler</title>
    <description>The latest articles on DEV Community by Stefan Fiedler (@sftaikonaut).</description>
    <link>https://dev.to/sftaikonaut</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F566914%2F31c42e95-106e-4574-be1f-20ded71ab4a0.png</url>
      <title>DEV Community: Stefan Fiedler</title>
      <link>https://dev.to/sftaikonaut</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sftaikonaut"/>
    <language>en</language>
    <item>
      <title>How to Docker? - The strategic value</title>
      <dc:creator>Stefan Fiedler</dc:creator>
      <pubDate>Mon, 09 Aug 2021 08:35:25 +0000</pubDate>
      <link>https://dev.to/sftaikonaut/how-to-docker-the-strategic-value-37l4</link>
      <guid>https://dev.to/sftaikonaut/how-to-docker-the-strategic-value-37l4</guid>
      <description>&lt;p&gt;Chances are you already know what Docker is, maybe you have already worked with it for a while or you just got started. Either way, you probably wouldn't want to go back. So for someone who might have missed out on the action, why is it that everyone keeps talking about Docker? Why should you switch and what &lt;strong&gt;strategic value&lt;/strong&gt; will you gain?&lt;/p&gt;

&lt;p&gt;This short introduction to &lt;strong&gt;virtualisation&lt;/strong&gt; and &lt;strong&gt;containerisation&lt;/strong&gt; is supposed to help you understand, how Docker can save you time, money and headaches. To understand why Docker is helpful in the first place, let's look at some of the most common issues when developing any kind of application, site or service.&lt;/p&gt;

&lt;h2&gt;
  
  
  But it works on my machine!
&lt;/h2&gt;

&lt;p&gt;Imagine the following scenario: You are supposed to support your coworkers during the development of an existing application. The first thing you do is check out the git repository to pull the most recent source code onto your local machine. Next, you install the application dependencies, in this example, we are using &lt;strong&gt;composer&lt;/strong&gt; and the &lt;strong&gt;node package manager&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So you might try to install the composer dependencies, but wait, what's that?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1- dealerdirect/phpcodesniffer-composer-installer v0.5.0 requires composer-plugin-api ^1.0 -&amp;gt; found composer-plugin-api[2.0.0] but it does not match the constraint.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Looks like you have a different composer version installed on your machine which is not compatible with the project. So you have to downgrade your composer installation to version 1.&lt;/p&gt;

&lt;p&gt;Next, you install the frontend dependencies using the node package manager, is that another error?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1npm WARN notsup Unsupported engine for semver@7.3.2: wanted: {"node":"&amp;gt;=10"} (current: {"node":"8.10.0","npm":"6.14.4"}) 2npm WARN notsup Not compatible with your version of node/npm: semver@7.3.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unsupported node version? This time we need to upgrade our locally installed version. But will this maybe break another project you have been working on? Do you have to down- and upgrade your tools every time you switch projects?&lt;/p&gt;

&lt;h2&gt;
  
  
  Local development and required services
&lt;/h2&gt;

&lt;p&gt;Finally, after hours of figuring out the appropriate versions of all the required tools you almost have the application up and running. All you're missing is a database to store the app's data, an SMTP server to send emails and a Redis instance to cache pages.&lt;/p&gt;

&lt;p&gt;You can imagine how all these services are again dependent on a specific version. Installing everything is going to take hours and even then you might run into more issues. Maybe you forgot to install a PHP extension and suddenly you have even more issues than when you started.&lt;/p&gt;

&lt;p&gt;Wouldn't it be nice if we could somehow avoid facing these challenges?&lt;/p&gt;

&lt;h2&gt;
  
  
  Docker to the rescue!
&lt;/h2&gt;

&lt;p&gt;This is where we meet Docker, an open platform for developing, shipping, and running applications.&lt;/p&gt;

&lt;p&gt;The basic idea is to &lt;strong&gt;separate the application environment from your local machine&lt;/strong&gt;. This environment should be the &lt;strong&gt;exact same for everyone&lt;/strong&gt; working on the project, it should &lt;strong&gt;contain all required tools and services&lt;/strong&gt; and it should be &lt;strong&gt;easily expendable/scaleable&lt;/strong&gt;. Such an environment is called a &lt;strong&gt;container&lt;/strong&gt; and the following summary from the official Docker website explains the main goal:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Source: &lt;a href="https://www.docker.com/resources/what-container"&gt;What is a container? Official Docker explanation&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Isn't this just a virtual machine?
&lt;/h2&gt;

&lt;p&gt;Chances are, you have worked or at least heard of a &lt;strong&gt;virtual machine&lt;/strong&gt;. It is basically a separate operating system running on top of your main operating system. Docker follows a similar route but avoids one main constraint - &lt;strong&gt;size&lt;/strong&gt;. A normal VM-image (containing the whole operating system) is much larger in size than a Docker image. This can be accomplished by Docker &lt;strong&gt;utilising the main OS's kernel&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integrations and the Docker-Hub
&lt;/h2&gt;

&lt;p&gt;There are already plenty of integrations for docker. An example would be hosting providers, supporting or offering Docker image-based solutions. This also nicely integrates into existing continuous delivery and deployment pipelines.&lt;/p&gt;

&lt;p&gt;We can't talk about Docker and not mention the Docker-Hub - a service build for finding and sharing images. You can find official vendor images for all kinds of use cases. Images range from simple web servers, database applications and even whole operating systems.&lt;/p&gt;

&lt;p&gt;See for yourself by &lt;a href="https://hub.docker.com/search?type=image"&gt;visiting the hub&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Docker - not if, but when?
&lt;/h2&gt;

&lt;p&gt;Making the switch to Docker should not be a question of &lt;strong&gt;yes or no&lt;/strong&gt;, but rather of &lt;strong&gt;when&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;The long- and short term benefits are endless, here are our top three:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Speed:&lt;/strong&gt; Developers are enabled to rapidly set up new or existing projects within minutes and share that same development environment with all team members.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reusability:&lt;/strong&gt; The same Docker image can then be used to speed up the deployment and save you the extra setup and maintenance of a traditional server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Testability:&lt;/strong&gt; Future updates can be tested and reviewed before being deployed to the production environment, decreasing the risk of running into issues post-deployment.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;This article will be part of a series about Docker best practices at Taikonauten. Stay tuned and we're happy about feedback and questions you want to know more about.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>devops</category>
      <category>containerization</category>
      <category>compose</category>
    </item>
    <item>
      <title>GDPR Compliant User Consent Management with Klaro</title>
      <dc:creator>Stefan Fiedler</dc:creator>
      <pubDate>Wed, 21 Apr 2021 13:44:59 +0000</pubDate>
      <link>https://dev.to/taikonauten/gdpr-compliant-user-consent-management-with-klaro-53i8</link>
      <guid>https://dev.to/taikonauten/gdpr-compliant-user-consent-management-with-klaro-53i8</guid>
      <description>&lt;p&gt;Managing user consent while complying to the latest GDPR policies can be very confusing and frustrating - but it doesn’t have to be!&lt;/p&gt;

&lt;p&gt;We would like to show you how to get started with &lt;a href="https://heyklaro.com/" rel="noopener noreferrer"&gt;Klaro&lt;/a&gt; - an &lt;strong&gt;open-source&lt;/strong&gt; and &lt;strong&gt;GDPR-compliant consent management tool&lt;/strong&gt; developed by the german company &lt;a href="https://kiprotect.com/" rel="noopener noreferrer"&gt;KIProtect&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you are new to the whole GDPR and cookie consent topic, please read our article: &lt;a href="https://dev.to/taikonauten/best-practises-to-build-gdpr-compliant-cookie-banners-with-klaro-nn3"&gt;Best practises to build GDPR-compliant cookie banners with Klaro&lt;/a&gt; &lt;/p&gt;

&lt;h1&gt;
  
  
  How to integrate Klaro GDPR-compliant consent management tool
&lt;/h1&gt;

&lt;p&gt;To get started, we will need two things: a copy of the &lt;strong&gt;Klaro widget&lt;/strong&gt; and a valid &lt;strong&gt;configuration&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Including the Klaro widget
&lt;/h2&gt;

&lt;p&gt;To use the widget on your site, simply embed the latest release using the provided CDN. Please see the &lt;a href="https://heyklaro.com/docs/integration/overview" rel="noopener noreferrer"&gt;official integration documentation&lt;/a&gt; to get a detailed explanation of the different options. The following snippet will get you started:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;defer&lt;/span&gt; 
        &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"application/javascript"&lt;/span&gt;
        &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.kiprotect.com/klaro/latest/klaro.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You can also &lt;a href="https://cdn.kiprotect.com/klaro/latest/klaro.js" rel="noopener noreferrer"&gt;download the latest release&lt;/a&gt; and self-host the widget using the following example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;defer&lt;/span&gt; 
        &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"application/javascript"&lt;/span&gt; 
        &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"klaro.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;!--&lt;/span&gt; &lt;span class="nx"&gt;point&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;downloaded&lt;/span&gt; &lt;span class="nx"&gt;file&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt; &lt;span class="nx"&gt;your&lt;/span&gt; &lt;span class="nx"&gt;webserver&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;--&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you now reload the page, nothing will have changed yet. We are still missing the configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Node.js integration
&lt;/h2&gt;

&lt;p&gt;If you are using the &lt;a href="https://www.npmjs.com/" rel="noopener noreferrer"&gt;node package manager&lt;/a&gt;, Klaro is also available as a Node.js module. Simply install it using:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

npm &lt;span class="nb"&gt;install &lt;/span&gt;klaro


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  How to configure Klaro
&lt;/h1&gt;

&lt;p&gt;After you have successfully included the widget using one of the options above, you create your configuration file. Klaro uses a &lt;strong&gt;central configuration object&lt;/strong&gt; to reference all of your services (things like Google-Analytics or YouTube videos). It will also &lt;strong&gt;allow translations to be set and updated&lt;/strong&gt;. There are many options and you should check the &lt;a href="https://heyklaro.com/docs/integration/annotated-configuration" rel="noopener noreferrer"&gt;official configuration template&lt;/a&gt; to see all available settings.&lt;/p&gt;

&lt;p&gt;A sample configuration for loading &lt;strong&gt;Google-Analytics&lt;/strong&gt; might look like this:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;klaroConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;privacyPolicy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/privacy.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;apps&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;name&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;google-analytics&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;title&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Google Analytics&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;purposes&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;statistics&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="na"&gt;cookies&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sr"&gt;/^ga/i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The configuration needs to be present in order to get the Klaro-widget to show up&lt;/strong&gt;. Let’s extend our previous example with our configuration:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="c"&gt;&amp;lt;!-- INCLUDE WIDGET --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;defer&lt;/span&gt; 
        &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"application/javascript"&lt;/span&gt;
        &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.kiprotect.com/klaro/latest/klaro.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- WIDGET CONFIGURATION --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;klaroConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;privacyPolicy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/privacy.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;apps&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt;
              &lt;span class="na"&gt;name&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;google-analytics&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="na"&gt;title&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Google Analytics&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="na"&gt;purposes&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;statistics&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
              &lt;span class="na"&gt;cookies&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sr"&gt;/^ga/i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
          &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you now reload the page, you should be greeted by the following consent-banner:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fto1jzj3ex887awtaq01i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fto1jzj3ex887awtaq01i.png" alt="Consent modal"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s take a closer look at our configuration!&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="nx"&gt;privacyPolicy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/privacy.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This value represents the URL or path to your privacy policy. It is mainly used inside the individual translation texts, to make references to the privacy policy.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="nx"&gt;apps&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;An &lt;strong&gt;app&lt;/strong&gt; is basically any service (tracking, embeds, etc.) that requires the user’s consent. Examples might be &lt;strong&gt;Google-Analytics&lt;/strong&gt;, &lt;strong&gt;Matomo&lt;/strong&gt;, &lt;strong&gt;Instagram&lt;/strong&gt;, &lt;strong&gt;Facebook&lt;/strong&gt; or &lt;strong&gt;Google Maps&lt;/strong&gt;. This of course might also be your own cookies or services you provide.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;google-analytics&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="c1"&gt;// internal name, reference when including 3rd-party scripts&lt;/span&gt;
&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                &lt;span class="c1"&gt;// should the option be enabled by default?&lt;/span&gt;
&lt;span class="nx"&gt;title&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Google Analytics&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// displayed name in modal&lt;/span&gt;
&lt;span class="nx"&gt;purposes&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;statistics&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;    &lt;span class="c1"&gt;// group (if multiple apps of the same kind)&lt;/span&gt;
&lt;span class="nx"&gt;cookies&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sr"&gt;/^ga/i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;            &lt;span class="c1"&gt;// regex matcher to determine cookies&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  How to update third-party scripts in Klaro
&lt;/h1&gt;

&lt;p&gt;Now that we have the widget up and running, we need to make sure the &lt;strong&gt;third-party scripts are not loaded until the user has consented&lt;/strong&gt; to the apps. As of right now, you might have a consent-banner but &lt;strong&gt;Google will still be tracking the user&lt;/strong&gt; in the background and cookies might still get stored on the user’s system.&lt;/p&gt;

&lt;p&gt;This is the default snippet used when including Google-Analytics. By default, this code would always execute once the page has been loaded.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

 &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;o&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;m&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;GoogleAnalyticsObject&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt;&lt;span class="p"&gt;[]).&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arguments&lt;/span&gt;&lt;span class="p"&gt;)},&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;o&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="nx"&gt;m&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementsByTagName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;o&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parentNode&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertBefore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;})(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;script&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://www.google-analytics.com/analytics.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ga&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;ga&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;create&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;UA-XXXXX-Y&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;auto&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;ga&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;send&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pageview&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;First let’s &lt;strong&gt;prevent the script from executing&lt;/strong&gt; by adding &lt;code&gt;type="text/plain"&lt;/code&gt; to the script-tag.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/plain"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="c1"&gt;// GA tracking code&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Next, we need to add a &lt;strong&gt;data-attribute&lt;/strong&gt; to tell Klaro what the script’s original type was, by adding &lt;code&gt;data-type="application/javascript"&lt;/code&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/plain"&lt;/span&gt;
        &lt;span class="na"&gt;data-type=&lt;/span&gt;&lt;span class="s"&gt;"application/javascript"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="c1"&gt;// GA tracking code&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Last, we have to tell Klaro which of the previously defined apps corresponds to this script by adding the app name as the &lt;code&gt;data-name="google-analytics”&lt;/code&gt; attribute. This is what you should end up seeing:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/plain"&lt;/span&gt;
        &lt;span class="na"&gt;data-type=&lt;/span&gt;&lt;span class="s"&gt;"application/javascript"&lt;/span&gt;
        &lt;span class="na"&gt;data-name=&lt;/span&gt;&lt;span class="s"&gt;"google-analytics"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="c1"&gt;// Info: data-name corresponds to name in configuration file &lt;/span&gt;
  &lt;span class="c1"&gt;// GA tracking code&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now the page should not be executing the Google-Analytics script until the user has consented to the tracking. That’s the basic setup done! No more tracking without the user’s consent.&lt;/p&gt;

&lt;h1&gt;
  
  
  Helpful guides and snippets
&lt;/h1&gt;

&lt;p&gt;Here are some common steps and configurations on how to get most out of your consent-widget:&lt;/p&gt;

&lt;h2&gt;
  
  
  How to change the default texts
&lt;/h2&gt;

&lt;p&gt;In order to change the default texts, you need to &lt;strong&gt;define the corresponding translation&lt;/strong&gt; inside your configuration. You can find the &lt;strong&gt;translation keys&lt;/strong&gt; for each language in the &lt;a href="https://github.com/KIProtect/klaro/tree/master/src/translations" rel="noopener noreferrer"&gt;official source code&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let’s assume we want to update the default modal headline, text and button labels:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;klaroConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;privacyPolicy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/privacy.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;apps&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;name&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;google-analytics&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;title&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Google Analytics&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;purposes&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;statistics&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="na"&gt;cookies&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sr"&gt;/^ga/i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="na"&gt;translations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;en&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;consentModal&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;title&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;My new fancy title!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// update the main title&lt;/span&gt;
                &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;description&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;A detailed description of what this is.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// main description&lt;/span&gt;
                &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;privacyPolicy&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Read our {privacyPolicy} right now!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="c1"&gt;// using {brackets} we can use placeholders&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;acceptSelected&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Press me!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="c1"&gt;// override accept button label&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Using these &lt;strong&gt;updated translations&lt;/strong&gt;, this is what the new modal should look like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7bre413zapm8jy6jnsyp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7bre413zapm8jy6jnsyp.png" alt="Consent modal with custom translation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: Customise your Klaro widget even further by overwriting the default CSS classes. &lt;/p&gt;

&lt;h2&gt;
  
  
  How to show a consent overlay on embedded content
&lt;/h2&gt;

&lt;p&gt;This is a very useful feature that not many people might know about. Imagine you are using embedded content like &lt;strong&gt;Facebook&lt;/strong&gt;, &lt;strong&gt;Google Maps&lt;/strong&gt; or &lt;strong&gt;Youtube&lt;/strong&gt;. Users might not want to load all of the embedded content when visiting a site and might want to allow only individual elements. Check the &lt;a href="https://heyklaro.com/docs/tutorials/contextual_consent" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt; for a detailed explanation.&lt;/p&gt;

&lt;p&gt;Let’s assume you have an &lt;strong&gt;embedded Youtube&lt;/strong&gt; video:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffp6ifntdl7ytrnnjpz82.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffp6ifntdl7ytrnnjpz82.png" alt="Embedded youtube video"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;iframe&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"560"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"315"&lt;/span&gt; 
        &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://www.youtube.com/embed/nXkgbmr3dRA"&lt;/span&gt; &lt;span class="na"&gt;frameborder=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt; &lt;span class="na"&gt;allow=&lt;/span&gt;&lt;span class="s"&gt;"encrypted-media;"&lt;/span&gt; &lt;span class="na"&gt;allowfullscreen&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/iframe&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;So let’s add Klaro and create a configuration including the following options:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;klaroConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;acceptAll&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;apps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;purposes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;marketing&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;youtube&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;contextualConsentOnly&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="c1"&gt;// this option enables inline consent&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We have added the &lt;code&gt;contextualConsentOnly&lt;/code&gt; option. Using this configuration, we need to update our iFrame. Add the &lt;code&gt;data-name=”youtube”&lt;/code&gt; attribute and update the &lt;code&gt;src=”...”&lt;/code&gt; attribute by adding the &lt;code&gt;data-src=”...”&lt;/code&gt; prefix.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj7t30fp1m9nccz0yk5ph.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj7t30fp1m9nccz0yk5ph.png" alt="Blocked embedded video"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;iframe&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"560"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"315"&lt;/span&gt; 
        &lt;span class="na"&gt;data-name=&lt;/span&gt;&lt;span class="s"&gt;"youtube"&lt;/span&gt;
        &lt;span class="na"&gt;data-src=&lt;/span&gt;&lt;span class="s"&gt;"https://www.youtube.com/embed/nXkgbmr3dRA"&lt;/span&gt; &lt;span class="na"&gt;frameborder=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt; &lt;span class="na"&gt;allow=&lt;/span&gt;&lt;span class="s"&gt;"encrypted-media;"&lt;/span&gt; &lt;span class="na"&gt;allowfullscreen&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/iframe&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;As you can see, the &lt;strong&gt;iFrame will no longer load initially&lt;/strong&gt; and you can enable the external service right where it would be displayed on the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to make a reusable React component
&lt;/h2&gt;

&lt;p&gt;If you plan to reuse the component in multiple projects, we recommend putting all Klaro code into a &lt;strong&gt;dedicated component&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../../styles/cookies.scss&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="c1"&gt;// Path to your cookie styles&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;CookieConfig&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./CookieConfig&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Path to your config file&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Cookies&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="nf"&gt;componentDidMount&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="c1"&gt;// Initialize Klaro cookie consent&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;Klaro&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;klaro&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// we assign the Klaro module to the window, so that we can access it in JS&lt;/span&gt;
    &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;klaro&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Klaro&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// we set up Klaro with the config&lt;/span&gt;
    &lt;span class="nx"&gt;Klaro&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;CookieConfig&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Cookies&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To use it, just add:&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;p&gt;&lt;span class="nt"&gt;&amp;lt;Cookies&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Klaro offers scaleable, future-proof and developer friendly GDPR consent management&lt;br&gt;
&lt;/h1&gt;

&lt;p&gt;Having worked with different libraries and providers, Klaro has proven itself to be a &lt;strong&gt;great alternative&lt;/strong&gt;. Any documentation is always a good indicator on the quality of the library and &lt;strong&gt;Klaro’s source code has been well documented&lt;/strong&gt;. Klaro is &lt;strong&gt;free of charge&lt;/strong&gt; and does &lt;strong&gt;scale well&lt;/strong&gt; with any website or application. Together with the many &lt;strong&gt;customisation options&lt;/strong&gt;, this consent management tool should cover most of your needs.&lt;/p&gt;

&lt;p&gt;As always, make sure to carefully check your requirements before choosing a user consent management solution. We will be releasing an article on best practises for building GDPR-compliant cookie banners with third party tools soon. Stay tuned!&lt;/p&gt;

</description>
      <category>gdpr</category>
      <category>cookie</category>
      <category>klaro</category>
      <category>consent</category>
    </item>
    <item>
      <title>WordPress vs. Kirby CMS - 2021 Feature Comparison</title>
      <dc:creator>Stefan Fiedler</dc:creator>
      <pubDate>Fri, 26 Feb 2021 15:36:47 +0000</pubDate>
      <link>https://dev.to/taikonauten/wordpress-vs-kirby-cms-2021-feature-comparison-40k8</link>
      <guid>https://dev.to/taikonauten/wordpress-vs-kirby-cms-2021-feature-comparison-40k8</guid>
      <description>&lt;p&gt;In the past we at Taikonauten have used both Kirby and WordPress on a regular basis to create stunning projects. Choosing the right content management system is always a difficult decision, so let’s take a look at their unique strengths and differences and how they affect digital product development!&lt;/p&gt;

&lt;h2&gt;
  
  
  How do Wordpress &amp;amp; Kirby store their data?
&lt;/h2&gt;

&lt;p&gt;The biggest and fundamentally most important difference is the way in which the data is stored:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://w3techs.com/technologies/overview/content_management"&gt;WordPress being the most popular CMS&lt;/a&gt; &lt;strong&gt;requires a database&lt;/strong&gt; to store its information such as users or blog posts. The database is a separate system that needs to be maintained and updated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://getkirby.com/"&gt;Kirby&lt;/a&gt; on the other hand &lt;strong&gt;utilises a hierachical file-based structure&lt;/strong&gt; to store its contents in files and folders inside the physical file system, much like you would store and organise files on your desktop.&lt;/p&gt;

&lt;p&gt;Not relying on a database eliminates the single point of failure (if the database fails - the page will no longer work) and Kirby’s powerful templating engine ensures much faster processing. Content can also be versioned much easier (&lt;a href="https://git-scm.com/"&gt;GIT&lt;/a&gt;, &lt;a href="https://subversion.apache.org/"&gt;SVN&lt;/a&gt;) as the files are stored in nested folders instead of database tables.&lt;/p&gt;

&lt;h2&gt;
  
  
  Differences in setting up Kirby or Wordpress
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://getkirby.com/docs/guide/quickstart"&gt;Kirby’s setup&lt;/a&gt; is done in a breeze – it’s easy, flexible and production ready in an hour leaving you more time to focus on developing the product. All that is required is a basic web server (&lt;a href="https://httpd.apache.org/"&gt;Apache&lt;/a&gt;, &lt;a href="https://www.nginx.com/"&gt;Nginx&lt;/a&gt;) and PHP. You can simply drag and drop the files onto your server and should be able to instantly start using your new Kirby site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://wordpress.org/support/article/how-to-install-wordpress/"&gt;WordPress’s setup&lt;/a&gt; has come a long way and most online platforms and providers offer a simple 1-click install. If you are installing WordPress manually however, the process get’s a little more complicated. First, you need to install and set up a new database. Next you will need to move the project files into your web server to serve them to the outside world. Finally when visiting your new WordPress site you’ll have to complete the installation process by following the instructions on the screen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Getting Kirby up and running is much easier and faster compared to WordPress&lt;/strong&gt; and the developers have also provided a great &lt;a href="https://getkirby.com/docs/guide/quickstart#download-and-installation"&gt;Starterkit&lt;/a&gt; download including lots of sample content so you can try it out yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to customise Kirby and WordPress using plugins and themes
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://wordpress.com/"&gt;WordPress&lt;/a&gt; itself is &lt;strong&gt;free and offers a wide range of commercial as well as free plugins&lt;/strong&gt; and themes. You won’t need any programming knowledge in order to extend and change your site’s look and feel. The included &lt;a href="https://wordpress.org/plugins/"&gt;plugin marketplace&lt;/a&gt; offers a &lt;br&gt;
&lt;strong&gt;quick and easy way to add new features&lt;/strong&gt;. Implementing new themes or plugins however will require a decent amount of very specific knowledge in order to use and extend the WordPress ecosystem.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://getkirby.com/"&gt;Kirby&lt;/a&gt; in comparison is &lt;strong&gt;paid-per-domain&lt;/strong&gt; but provides &lt;strong&gt;features like multi-language sites&lt;/strong&gt; out of the box. The rather &lt;a href="https://getkirby.com/plugins"&gt;small library of external plugins&lt;/a&gt; will force you to implement custom solutions more often. These custom solutions however make use of the &lt;a href="https://getkirby.com/docs/guide/blueprints/fields"&gt;extensive library of pre-defined field types and building blocks&lt;/a&gt; for images, urls, texts and many more. &lt;strong&gt;Developing new features is much faster, easier&lt;/strong&gt; and more intuitive compared to WordPress.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to find documentation and support using Kirby &amp;amp; Wordpress?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://getkirby.com/docs/guide/content/introduction"&gt;Kirby’s documentation&lt;/a&gt; is very organised and includes &lt;strong&gt;hundreds of code snippets and examples&lt;/strong&gt; that you will most likely find very helpful. In case the documentation does not offer the right answer, the &lt;strong&gt;small but very technical community&lt;/strong&gt; has proven to be incredibly helpful and the &lt;a href="https://forum.getkirby.com/"&gt;forum&lt;/a&gt; is constantly updated and moderated by the official developers.&lt;/p&gt;

&lt;p&gt;WordPress also offers an &lt;strong&gt;extensive&lt;/strong&gt; &lt;a href="https://developer.wordpress.org/"&gt;official documentation&lt;/a&gt; but the amount of content is very overwhelming and finding the right piece of information can be frustrating. WordPress attracts a &lt;strong&gt;huge audience generating content&lt;/strong&gt;, which leads to &lt;strong&gt;more time being spent in doing research and validation&lt;/strong&gt; than actual problem solving.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which CMS is faster and safer?
&lt;/h2&gt;

&lt;p&gt;This is where Kirby will outshine WordPress by a lot! &lt;strong&gt;Kirby’s page load time is much, much faster compared to WordPress&lt;/strong&gt;. The many different &lt;a href="https://getkirby.com/docs/guide/cache"&gt;caching options and providers&lt;/a&gt;, if used correctly, will result in speeds similar to static html pages.&lt;/p&gt;

&lt;p&gt;Maintenance also matters: &lt;strong&gt;Kirby being a lightweight system&lt;/strong&gt; is easier to keep in shape. &lt;strong&gt;Updates are usually very easy to install&lt;/strong&gt; and won’t mess with your existing data. &lt;/p&gt;

&lt;p&gt;A common issue with WordPress is having to wait for plugins or themes to update after the WordPress core has been updated. This is cause for &lt;a href="https://www.wpwhitesecurity.com/statistics-highlight-main-source-wordpress-vulnerabilities/"&gt;security concerns&lt;/a&gt; and has proven to be a common target for many WordPress sites.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which CMS is better?
&lt;/h2&gt;

&lt;p&gt;There is no right or wrong when choosing your CMS but it can have a &lt;strong&gt;crucial impact on your project planning and development times&lt;/strong&gt;. Times are changing quickly and so are the requirements for a modern website. &lt;strong&gt;Loading times and security concerns are becoming more important than ever&lt;/strong&gt;. WordPress may offer a lot of extensions but how many of these are you actually going to end up using?&lt;/p&gt;

&lt;p&gt;Kirby offers a future proof alternative that tries to fill the gap between a minimalistic static blog and a full blown e-commerce platform.&lt;/p&gt;

&lt;p&gt;Consider both options before your next project and adapt to your customer’s needs with the future in mind.&lt;/p&gt;

&lt;p&gt;What are your experiences? We’re curious!&lt;/p&gt;

</description>
      <category>cms</category>
      <category>kirby</category>
      <category>wordpress</category>
    </item>
  </channel>
</rss>
