Posts with Tag

Javascript

When I developed my Minimal Google Analytics 4 snippet, I thought about preventing it from being blocked by various AdBlockers.

Along with AdBlock Plus, I am also using the DuckDuckGo Privacy Protection extension in Safari. I am using the DuckDuckGo browser on its own as well.

DuckDuckGo, along with restrictive ad blockers, tends to block requests heading to the google-analytics.com domain. This is done on purpose, and I fully understand that.

This is why I described mitigation techniques (Minimal Analytics 4 - masking (hiding) requests).

This technique allows you to utilize Redirect 200 to mask requests to external domains under your domain.

By implementing a redirect as follows:

/g/collect https://www.google-analytics.com/g/collect 200

Instead of calling the address below in a script

https://www.google-analytics.com/g/collect

I am calling this

https://www.example.com/g/collect

Behind the scenes, thanks to Redirect 200, I am sending requests to Google Analytics that are not blocked by either AdBlock Plus or DuckDuckGo.

This solution, however, has 2 major flaws.

Read More about Combining Methods to Prevent Adblockers from Blocking Your Minimal Google Analytics 4 Snippet
WebDev Hugo
Implementing Google Adsense without affecting site performance
Published
Read Time 6 min.

Recently, I have been in contact with several people who have been thanking me for posting articles that have helped them significantly with their technological struggles or in easing their issues.

Some of them have been so happy that they would like to know how to donate a bit to support the cause. While this gesture is appreciated, most of the activities on my site are non-profit.

I used to have ads displayed on my website when it was hosted on WordPress. However, after migrating to Hugo, I soon realized that despite the speed benefits, the web performance was being compromised due to ads served through Google AdSense.

I managed to significantly reduce the costs for my website, so I decided to take the step of removing ads altogether, and I have been happy with this decision.

WebDev Hugo
Supercharge your headings in Hugo with Render Hooks
Published
Updated
Read Time 13 min.

The great thing about Hugo, a static site generator, is that it got a lot of options for customisation and more are constantly added.

There are templates embedded into it, but they can be easily overridden by custom templates, like headings, through render hooks.

WebDev
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.

Categories