Let’s say you’re launching a significant update to a website. A lot is changing: the theme, lots of URLs, maybe the CMS or backend, and so forth. And the team creating the website is working from various IP addresses on the development site. What’s the best way to handle the transition with Analytics?

Lately (after having a website launch without Analytics earlier this year) I’ve been handling this in a very particular way, and I’ve grown to really like it. Basically, I’m using hostnames (dev.domain.com, www.domain.com, etc.) in Google Tag Manager to automatically split traffic to different Analytics properties. I’m doing this by using a “lookup table” for my Analytics IDs (instead of using a “constant” variable).

Read more

This post was originally created on November 11, 2016, and updated on April 20, 2024. It previously provided instructions for setting up error tracking with custom error pages, Google Tag Manager, and Universal Analytics. However, things are a bit different today with Google Analytics 4, so I’ve edited this post significantly to reflect those updates.


I was with a client browsing their website to review some new content recently, and we ran across a “500 – Internal Server Error” warning on one of the most important pages. (That means their server encountered an error that prevented it from successfully serving the page.) We were unaware of this and didn’t know how long it had been an issue.

Most websites (even big ones) do not automatically report such errors. Problems like this are usually exposed when someone (a coworker, an angry website visitor, etc.) finds and reports them. That’s terrifying if you’re responsible for an organization’s web presence. What if visitors are experiencing errors and nobody is saying anything?

One way to monitor website errors is with custom GA4 reports. In this blog post, I’ll show how most content management systems and website platforms already provide this information to GA4 in a way that allows you to report on it. If you’re not getting that data in GA4, I’ll also give you some notes about changing that.

Read more