Cookie Consent on my Azure Blog

Sven Malvik Sven Malvik Connect Aug 29, 2020 · 1 min read
Cookie Consent on my Azure Blog

Today, I was asked how I integrated the cookie consent on my Azure Blog that is based on Jekyll. Jekyll transforms plain text into a static websites or blogs. I needed to add cookie consent to my Azure Blog because I wanted to add a Facebook comment plugin together with Google Analytics. Instead of helping this one person, I thought I may help others as well with this short post.

Download the file cookie-consent.html and move it into the _include-folder of your Jekyll project.

Add the line of code at the end of your <body> section

Include cookie-consent.htmlInclude cookie-consent.html

Fix the downloaded code

The code for the cookie-consent requires two files, ga.js and chatbutton.js. Otherwise the build will fail. What I did was removing the code section entirely from cookie-consent.html.

Remove code for cookie foundRemove code for cookie found

Add privacy page

The cookie-consent has a button More info that points to a privacy page. I add an empty /privacy.html-file to the root folder, and then added content that I got from You might also want to add the privacy page to the menu which can be done in the _config.yaml-file.

Join Newsletter
Get the latest updates right in your inbox. I never spam!
Sven Malvik
Written by Sven Malvik