Paolo Bietolini

Home | Feed Atom

DDIA: Capitolo 1 — Applicazioni affidabili, scalabili e manutenibili

Questi appunti fanno parte di un progetto di Learn in Public. Ogni settimana leggo e riassumo un capitolo di Designing Data-Intensive Applications di Martin Klepmann. Gli appunti sono presi in inglese e tradotti in Italiano da Claude. Contestualmente al libro sto lavorando ad un progetto di creazione ed ingestion di …

You don't need a landlord to censor You

If you’ve ever read this blog, you know I work in analytics and data collection in MarTech. And if you’ve ever read this blog, I will never know it. Despite what I do for a living, this site has no way of tracking you. I even installed the Google Fonts on my own server so your IP address never reaches Google, and I …

Making hexdump 23 times faster (and what I've learned)

Last month I wrote hexdump from scratch and admitted I didn’t know a good alternative to printf per row. I found it: one fwrite per 64 KiB chunk instead of 128 million calls into stdio, and a 23× speedup, most of it from the part I thought was boring.

Remigrate them all

Yes, I’m saying we should remigrate them. No — deport them. All of them, down to the last one. They live here, in our country, the one we had the privilege of being born in, and with sheer ingratitude they drain our resources, take our jobs, and drive prices up.

Remigriamoli tutti

Sì, dico di remigrarli. Anzi, deportarli tutti. Tutti, dal primo all’ultimo. Stanno qui nel nostro paese, dove noi abbiamo avuto il privilegio di nascere, e con ingratitudine sfruttano le nostre risorse, ci tolgono il lavoro e fanno alzare i prezzi.

Corso Google Tag Manager, Episodio 1: lo script e il Data Layer

Questo è il primo episodio di una serie dedicata a Google Tag Manager. L’obiettivo non è il solito tutorial “clicca qui, poi qui”: voglio spiegare come funziona GTM davvero, sotto l’interfaccia, e demistificare alcune convinzioni che negli anni si sono sedimentate attorno allo strumento. Si parte dal client-side, la …

Writing hexdump from scratch

Say we want to inspect a corrupted file. To figure out its real type we can check its signature, the first few bytes of the file. On Unix-like systems, the tool for the job is hexdump: a program that shows the hexadecimal content of a file or of a data stream.

Learning C: Conway's Game of Life, Three Times

After reading the rules on Wikipedia, I set out to understand 2D grids. I spent a good hour drawing grids and numbering indices to see how they move across rows and columns. I knew I’d need two nested loops to walk the cells, so I wanted to first understand the foundation of the problem: what the game’s world is made …

A NaN where a Long should be

A PySpark TypeError that looked like a schema bug was actually three steps upstream. Pandas can’t represent what BigQuery hands it, (nested structs, nullable integers, timezone-aware timestamps, arbitrary-precision numerics) so every downstream line is a patch against a loss that happened at the moment pandas entered …

Arrow over the wire

Four lines of Spark config to read BigQuery. Underneath: a gRPC read session, one stream per Spark partition, Arrow end-to-end, server-side column and filter pushdown, and dynamic rebalancing when executors finish early. A walkthrough of what those lines actually trigger — and why the middle format isn’t replaced with …

[Case Study] Rebuilding analytics for a multi-domain tourism SPA

A large-sized Italian tourism operator running hop-on-hop-off bus tours and experience bookings across three domains came to me with a common problem: their advertising platforms were not receiving reliable conversion data. Meta, LinkedIn, Google Ads, and TikTok dashboards told conflicting stories. Attribution was …

GTM Server-Side vs Client-Side: Real Benchmarks and Honest Trade-Offs

Server-side GTM promises better performance, more accurate data, and longer cookie lifetimes. But the benchmarks tell a more complicated story than vendor blogs admit. This article compares client-side and server-side GTM across five dimensions — page speed, data accuracy, cookie durability, cost, and complexity — …

Google Tag Gateway vs Server-Side GTM: Which One Do You Need?

Browser tracking is losing signal. Safari caps cookies at 7 days, ad blockers strip requests to googletagmanager.com, and Firefox blocks third-party resources by default. Google Tag Gateway and server-side GTM both solve this, but they take fundamentally different approaches. This guide compares them head-to-head with …

GTM MCP Server: AI-Powered Google Tag Manager Automation

Managing GTM at scale is tedious. Creating GA4 ecommerce tracking means 12+ tags, matching triggers, and variables—each requiring careful configuration. I built an open-source MCP server that connects Claude and ChatGPT directly to the GTM API. Describe what you need in plain English, and the AI handles the …

Cross-Domain Tracking in GA4: Setup Without Data Loss

When users move between your domains, GA4 treats them as new visitors by default—inflating user counts and breaking attribution. This guide covers proper cross-domain configuration in GA4 and GTM, troubleshooting self-referrals, handling payment gateways, and testing to ensure session continuity.

GA4 Custom Dimensions & Metrics: When and How to Use Them

GA4 default parameters cover most cases, but custom dimensions unlock business-specific insights. This practical guide explains when you actually need them, the three scope types (event, user, item), implementation via GTM, quota management, and real examples for ecommerce and lead generation sites.

How GA4 Counts Millions of Users with 12 Kilobytes: The HyperLogLog Algorithm

Open any GA4 report and look at Total Users. Then run COUNT(DISTINCT user_pseudo_id) in your BigQuery export. The numbers won’t match. They’re usually within a percent or two, and there is no setting that makes them. That gap isn’t a bug, and it isn’t sampling. It’s a deliberate engineering decision: GA4 never actually …

GTM Consent Mode V2: Complete Implementation Guide

Google Consent Mode V2 became mandatory for EEA advertisers in March 2024. Without it, you lose remarketing audiences and conversion data. This practical guide covers the two new parameters (ad_user_data, ad_personalization), basic vs advanced modes, GTM implementation with popular CMPs, and verification steps.

GA4 Debug Mode: Complete Troubleshooting Guide

DebugView is essential for validating your GA4 implementation, but it often refuses to show data when you need it most. This practical guide covers all methods to enable debug mode, diagnose why events are not appearing, and fix the 18+ common issues that break DebugView.

Google Tag Manager Server-Side: Implementazione On-Premise con Docker

Implementare GTM Server-Side su infrastruttura self-hosted riduce i costi da 50-150 €/mese (Google Cloud o servizi terzi) a 5-20 €/mese, garantendo compliance on-premise essenziale per settori regolamentati. Questa guida tecnica copre l’implementazione completa con Docker: setup container, configurazione DNS, reverse …

Implementing Server-Side GTM with Docker: On-Premise Solution Guide

Implementing GTM Server-Side on self-hosted infrastructure reduces costs from €50-150/month (Google Cloud) to €5-20/month while ensuring on-premise compliance essential for regulated industries. This technical guide covers complete Docker implementation: container setup, DNS configuration, Caddy reverse proxy with …

Measurement Protocol. Cos'è e come funziona

Google Analytics 4 (GA4) è una piattaforma potente per raccogliere e analizzare dati sul comportamento degli utenti. Ma cosa fare se vuoi inviare dati personalizzati a GA4, magari da un’applicazione o un sistema che non usa un browser? È qui che entra in gioco il Measurement Protocol.

Problemi con il form listener per Elementor

Come il listener per i form di Elementor blocca la Consent Mode ovvero sul perché non copincollare gli script da Internet Per un cliente con Elementor ho integrato uno script trovato online per tracciare gli invii dei form dal suo sito. E mi ha causato due settimane di mal di testa. Ora, prendiamoci la manina e seguimi …

Google Tag Manager Server-Side: Panoramica Tecnica

Il tracciamento server-side sposta l’elaborazione dei dati dal browser dell’utente ai server aziendali, offrendo maggiore controllo, precisione e conformità alla privacy. Questa guida tecnica spiega come funziona GTM Server-Side, quando ha senso implementarlo, e perché bypassare gli adblocker non è una buona ragione …

Google Tag Manager Server-Side: Technical Overview

Server-side tracking shifts data processing from the user’s browser to company servers, offering greater control, accuracy, and privacy compliance. This technical guide explains how GTM Server-Side works, when it makes sense to implement it, and why bypassing adblockers is not a good reason to adopt it.

Fixing Direct Traffic Inflation in GA4 for Single Page Applications

The Problem If you’re running a Single Page Application (SPA) built with frameworks like Nuxt.js, Next.js, React Router, or Vue Router, you might notice an unusually high percentage of Direct traffic in your Google Analytics 4 reports. This happens because: SPAs don’t trigger traditional page loads - When users …