Knowledge base glossary
What is Page Tagging? A short definition.
In website analytics, page tagging refers to the practice of adding small snippets of code, known as tags, to the pages of a website in order to track user behavior and gather data about how visitors interact with the site.
This data is then used to improve the website’s performance and optimize its content for search engines.
Page tagging is an important part of modern web analytics, as it allows website owners to gain valuable insights into the behavior of their visitors.
How page tagging works
Most tags are pieces of JavaScript. The tag runs in the visitor’s browser and sends data about the page view, clicks and other events to the analytics tool.
Many websites manage their tags with a tag manager. Google Tag Manager, for example, is installed by adding two snippets of code to each page. After that you add and change tags, and the triggers that make them fire, in the Tag Manager interface instead of in the website’s code. Our beginner’s guide to Google Tag Manager explains the setup.
Page tagging vs log file analysis
Log file analysis works without any code on the page. Every web server already records requests in its access logs, and a tool such as Matomo Log Analytics can import those logs (Apache, Nginx and IIS formats, among others) and build reports from them. This picks up visitors who use ad blockers and can report on visits from before the tool was installed.
The downside is that logs only see what reaches the server. Matomo lists screen resolution, page titles, events, heatmaps, session recordings and form analytics as things log analysis can’t track. For those you need page tags.
Server-side tagging
Server-side tagging moves part of the work out of the browser. Instead of each vendor’s tag sending data straight from the page, the data goes to a server container that you control. In server-side Google Tag Manager, a “client” in that container receives each request and turns it into events. Tags then send those events on to tools such as GA4 or ad platforms. You decide how the data is shaped and where it goes. The server can run in your own Google Cloud project or in another environment, and Google recommends serving it from your own first-party domain. Read more in getting started with server-side GTM.

