Posts in Category

WebDev

On the 16th of March 2022 Google announced its plans for a shutdown of Universal Analytics property and replace it fully with Goole Analytics 4 (v4) that been in the market since late 2020.

Google like to kill off their services. Luckily, this is not about shutting down Google Analytics but only the method, how analytics data are collected from websites. If you have been using Google Analytics for some time, then it’s more likely that you have been using Universal Analytics. You will know that by looking at your tracking code that will carry UA- on front of the numbers.

Analytics in its 4th version (UA is 3rd) has been developed for some time, but it wasn’t adopted as quick as Google could expect (or want), this is why they forcing a change by shutting down one in favour of another.

Read More about Google Universal Analytics property is shutting down. Here is what you need to know.
Implementing JavaScript Delay for Cookie Consent Banner
Published
Updated
Read Time 5 min.

Over some time I have been looking for ideal Cookie Consent Banner implementation on my websites. The main goal was to make sure it’s not causing CLS (Cumulative Layout Shift) resulting in poor Core Web Vitals (and downgrading website in Google Search).

I found the solution that worked for me for some time.

Together with other optimisation works I managed to achieve my goal, however, from time to time I saw a spike in PageSpeed Insight for some pages and I couldn’t figure out what else I could do to make sure that Cookie Banner (Bar) is not causing CLS.

Prevent Google Analytics from being blocked by AdBlocker
Published
Updated
Read Time 7 min.

You may say what you want about Google Analytics, especially about how “they” are, apart from displaying data for you, using data gathered for “their” business purpose (forget about privacy). If you are a website owner and you are looking for a reasonable tracking method for your visitors, this is the solution that you will pick in the first place.

The problem with Google Analytics is that their tracking script weights a lot and that is slowing down your website.

Track your 404 traffic the smart way
Published
Updated
Read Time 2 min.

When I moved into a static website made using Hugo I optimised almost everything, including the Google Analytics script. Instead of bulky code loaded from Google, I used Minimal Analytics.

Initially, I put it as always, in the head of my website. Later on, I added it to my 404.html page. I created my own 404 page to override the default Netlify landing page that appears when the visited URL was not found.

The idea was initially to find broken links that visitors are using and to fix them with relevant redirection. However, it didn’t take long until my analytics were spammed by stupid people (and their bots) trying to find a way to break in to my site.

Not so fast with AVIF, WebP is still the way
Published
Read Time 3 min.

When I moved to Hugo with my website, I looked to optimise everything and implement new techniques. Once Safari gain native WebP support back in 2020, I implement WebP following PawelGrzybek.com - WebP and AVIF images on a Hugo website. The post introduced not only how to implement WebP (at the time when Hugo <0.83 haven’t support it), but also shown how to go step further by implementing AVIF.

This method require you to have WebP/AVIF files stored along with PNG/JPG and not relay on rendering them when the site is build.

I was interested in implementing this as well, but after some tests in my environment I decided not to, and here I will explain why (and it is not about browser compatibility — Safari incompatibility).

Migrating business site from Namesco to SiteGround
Published
Read Time 10 min.

For over a couple years my employers website been served from shared hosting solution on Namesco. On recent years however, we feel that we been left behind. It started with just PHP, where we stick with the 7.3 version without not plan to go into 7.4 and not thinking even with 8.0. Until significant issues with performance of the servers (where even Customer Support couldn’t help without persuading you to migrate to dedicated servers), it was time to think what’s next.

Categories