Skip to main content
.com domains from $2.99 — free WHOIS privacy on every name

Instrumentation · Beginner · 30 minutes, tag weight included

How to add google analytics — Install the Tag, Then Measure What the Tag Cost You

You need the numbers, and you would rather not discover six months later that the tag is firing twice and costing you a tenth of a second on every page.

The short answer

Install GA4 once, prove it fires once, and then measure what it costs the page. The tag is a third-party script running on every request you serve, so it belongs in the same performance budget as everything else: check its transferred size and its main-thread time in the DevTools Performance panel, and check the network log for exactly one collect request per page view rather than two.

The duplicate install is the classic failure and it is invisible from inside the reports — every figure is simply inflated. The other half of this runbook is consent: measurement is subordinate to the visitor's choice, and a consent layer that fires after the tag has already collected is worse than no banner at all.

By the HostingFast team · Reviewed 24 August 2026

Beginner

Skill floor

5

Stages in the runbook

Free

Price of help

Proven

Tested on the live platform

Written for someone who will read a network waterfall as well as a dashboard. GA4 is genuinely useful, and it is also a script you are choosing to run on every page, which means it earns the same scrutiny as any other dependency.

Two things to verify, both in DevTools. One collect request per page view, and a main-thread cost you have actually looked at. Everything else on this page is downstream of those two checks.

One tag, and how to prove it

Open the Network panel, filter for the collect endpoint, and load a page. One request per page view is correct. Two means a plugin and a hardcoded snippet are both firing, every session is counted twice, and every conversion rate you have reported is wrong by roughly half. It is a five-second check that nobody runs until the numbers stop making sense.

Pick one installation route and delete the other. A plugin gives you dashboards and consent hooks; a snippet in the theme header gives you the tag and nothing else. Both are fine. Both at once is the single most common measurement bug on WordPress sites.

What the tag costs, in bytes and milliseconds

Record a Performance trace and look at the third-party summary: script evaluation time attributable to the analytics library, plus its transfer size. On a lean page it is often the largest third-party item present. That is not a reason to remove it, but it is a reason to know the figure before adding a second tag on top.

Load it asynchronously, keep it out of the critical path, and resist stacking a tag manager, a heatmap tool and two pixels alongside it without re-measuring. Third-party scripts compound: each one is small, and the total is what your visitor's phone has to execute.

Consent decides whether anything is collected

The banner has to gate the tag, not follow it. A consent implementation that loads analytics on page load and then asks permission has already collected the data it was asking about. Configure the plugin or tag manager so measurement is denied by default and enabled by the visitor's decision.

Expect a gap between your analytics figures and your server logs as a result, and treat that gap as correct rather than broken. If the discrepancy bothers you, the server's own log-based statistics in cPanel count every request with no tag and no consent question at all — a useful cross-check on traffic volume.

Make it report on speed, not only on visits

GA4 can receive Core Web Vitals as events, which turns your own analytics into field data segmented by page, device and country — far more actionable than a synthetic score from your own laptop on fibre. Send LCP, CLS and INP as events and you can finally see which template is slow for real people.

Then define the handful of events that mean something: form submissions, key clicks, purchases. A short deliberate list beats a wall of defaults nobody opens twice. If you would rather the data never left your own hosting, Matomo installs in one click from Softaculous and keeps it all on your account.

Traffic climbing on the chart without the site slowing down

The platform this was instrumented on

These checks were run on the hosting we operate, with the log-based statistics in cPanel available as a cross-check and Softaculous on hand if you would rather self-host the analytics entirely. One-click installs cover WordPress and 400+ other applications, Matomo among them.

Already hosted somewhere slower? We migrate the whole site free of charge, and it keeps serving visitors the entire time.

  • Server-side log statistics in the panel, with no tag involved
  • Softaculous one-click installs, so self-hosting is a single click
  • Free migration if the site is currently somewhere slower
  • Engineers on shift when a tag or a consent layer misbehaves

Why HostingFast

Standard on every plan

The duplicate check, first

One filtered network request tells you whether every figure you have reported is inflated by roughly half.

The tag has a budget

You measure its transferred size and main-thread time, so a second pixel is a decision rather than an accident.

Consent in the right order

Denied by default, enabled by the visitor. A banner that fires after collection has already begun is decoration.

Field data, not laptop data

Core Web Vitals sent as events give you real-device numbers segmented by template, which is where slow pages actually hide.

A log-based cross-check

cPanel's own statistics count requests without a script, which settles most arguments about missing traffic.

Self-hosting as a real option

Matomo is one Softaculous click away if you would rather the data never left your own account.

Quick Start

From order to online

  1. 1

    Create the property, take the one string

    A GA4 property with a web data stream for your domain. Out of the entire setup your site needs exactly one value: the measurement ID.

  2. 2

    Install it once, by one route

    Plugin or theme snippet, never both. Then filter the Network panel for the collect endpoint and confirm exactly one request per page view.

  3. 3

    Gate it behind consent

    Measurement denied by default and enabled by the visitor's choice. Reload with the banner dismissed both ways and confirm the tag obeys each one.

  4. 4

    Measure what it cost

    A Performance trace, third-party summary, script evaluation time and transfer size. Write the figure down; it is the budget any future tag has to fit inside.

  5. 5

    Send events worth reading

    Core Web Vitals plus a short list of real conversions. Verify each in the realtime report by triggering it yourself, then stop adding.

Built In

Loaded onto every plan

  • Softaculous on board for one-click application installs
  • WordPress and 400+ other applications installed in one click
  • Your existing site moved across by our engineers, free of charge
  • cPanel — the control panel most of the industry already runs
  • NVMe SSD storage on every tier, including the entry plan
  • LiteSpeed caching compiled into the server, not bolted on by plugin
  • Per-site PHP version switching from the control panel
  • Staging environments for rehearsing a change before it ships
  • Free SSL on every plan, reissued automatically before it can expire
  • Human support on duty every hour of every day

Frequently Asked

What people ask us most often

How do I check whether the tag is firing twice?

Open the Network panel, filter for the collect endpoint, and load a page: one request per page view is correct, two means you have both a plugin and a hardcoded snippet installed. Do this before trusting any number in the reports, because a duplicate install inflates everything uniformly and looks entirely plausible from inside the dashboard.

How much main-thread time does the GA4 tag actually add?

Record a Performance trace and read the third-party summary, which attributes script evaluation time per origin. The figure varies with device and with what else you have loaded, which is the point: measure it on a throttled mobile profile rather than on your own desktop, then treat it as the budget any further tag has to fit within.

Can I get real-user LCP figures out of GA4?

Yes — send the Core Web Vitals as events and you get field data segmented by page, device and country, which is far more useful than a synthetic score from your own connection. It is the quickest way to discover that one template is slow on mobile while your Lighthouse run on fibre looked perfect.

Does moving the tag into a tag manager make the page faster?

Not by itself. A tag manager is another container script to download and execute, and it usually ends up hosting more tags rather than fewer. It buys you deployment convenience and consent control; if you keep exactly one tag, loading it directly is the lighter option and you should measure both before deciding.

Keep reading

  • How to Back Up WordPress

    Set a recovery target, time a real restore on a staging clone, and keep one copy off the platform — beginner, roughly 30 minutes of setup.

  • How to Create a Contact Form

    A form that submits, sends over SMTP and is proven to arrive at an external address — beginner, roughly 30 minutes.

  • DNS (Domain Name System) (Glossary)

    The lookup layer that turns a name into an address, with the practical consequence for anyone timing a first byte.

  • Secure Hosting

    Imunify360, account isolation and hardened defaults for security-first builds.

  • Plesk Hosting

    Shared hosting on Plesk for anyone who would rather not use cPanel.

Changing hosts? Run through our checklist first.

A straightforward sequence for a switch your visitors never feel: which files move first, how to shift email across without losing a single message, the right moment to repoint DNS, and the two mistakes behind almost all the downtime we get asked to rescue.

You'll get the checklist email, then occasional pointers on keeping a site running fast. Unsubscribe the moment you want out — the privacy policy covers the rest.

Measure on hosting that is already quick.

NVMe behind a LiteSpeed cache, log-based statistics in the panel, one-click installs, and free migration from wherever you are now.

View Secure Hosting plans