How to Add Google Analytics to WordPress (GA4 Setup)

If you want to add Google Analytics to WordPress, the hard part isn't pasting a code snippet. It's choosing one clean method, tracking the actions that bring in customers, and checking that the numbers are real. Here is a practical walkthrough for business owners.

Why analytics matters for your business

You may be paying for Instagram or Google ads in sums, but once someone clicks, only analytics tells you what happens next. Google Analytics 4 (GA4) shows which channels bring visitors, which pages they open and whether they reach an enquiry. That is how you separate the sources that produce customers from those that only spend budget.

One rule matters more than the rest: pick a single installation method. Running two at once doubles visits and events, and your reports stop being trustworthy.

Step one: create the GA4 property and data stream

Sign in to Google Analytics, create a property and set your time zone and currency. Then add a web data stream with your site address. You will receive a measurement ID that starts with the letter G. You need it whichever method you choose.

Keep enhanced measurement switched on in the stream settings. It automatically records scrolling, outbound link clicks and a few other interactions without extra setup.

Three ways to connect GA4 to WordPress

The right choice depends on how much you need to track and who maintains the site.

  • Site Kit by Google plugin. Google's official plugin. You sign in with your Google account, it inserts the code for you and shows key figures in the WordPress dashboard. Good if you'd rather not touch code. The downsides are one more plugin and limited flexibility for custom events.
  • Google Tag Manager. You install the container once, then manage GA4, ad pixels and events inside Tag Manager. This is the best fit when you need to track phone clicks, Telegram clicks and form submissions, or run several marketing tools.
  • Code in the site head. Add the GA4 snippet with a header-code plugin or through a child theme. Avoid editing your main theme files, because updates will wipe your changes. It is simple, but custom events will need extra code.

Which events to track first

Pageviews alone say little about a business. The value lies in actions that lead to a sale. For a typical company site in Tashkent or the regions, start with these:

Once they work, mark the important ones as key events. Then submit a test enquiry and confirm the event appears once, not twice.

  • contact or enquiry form submissions (via the form plugin's event, Tag Manager or a thank-you page);
  • clicks on your phone number;
  • clicks through to Telegram or another messenger;
  • purchases, if you run a WooCommerce store with ecommerce events enabled.

How to avoid duplicate tracking

Double counting is the most common reason numbers look odd. Before adding code, check whether analytics is already connected through your theme, an SEO plugin or an old statistics plugin. After installing, open a page's source and search for the measurement ID. It should appear in only one tag.

Then visit your own site and find your visit in the real-time report. If it is counted once, you are fine. Don't test only while logged in as an administrator, since some plugins hide the tracking code from logged-in users.

Caching, cookie consent and Search Console

Caching and script-optimisation plugins sometimes delay or merge analytics code, so data is collected only partly. Re-check data collection after switching on any optimisation. The same goes for a cookie consent banner: make sure it doesn't block analytics entirely.

Link GA4 with Search Console so Google search queries and landing pages appear next to visitor behaviour. That is especially useful if you grow the site through SEO. Also filter out internal traffic from your own team.

The one-week check and access

After a week, compare reports with reality. Traffic sources should be identified correctly, key events should match actual enquiries in your CRM or Telegram, and there should be no unexplained spikes in direct traffic. If something looks wrong, check for double installation first.

Give contractors access through GA4 user management rather than the password to your company's Google account. You can then remove access whenever you need to.

If you want analytics, SEO and advertising to work as one picture, markdev can help with SEO optimisation in Uzbekistan, including analytics setup. Tell us about your project and we will suggest where to start.

FAQ

Which method is best for adding Google Analytics to WordPress?

For a simple site with few events, Site Kit or a header-code plugin is enough. If you need to track forms, calls, Telegram clicks and ad pixels, Google Tag Manager is more convenient. Use only one method either way.

Why does Google Analytics show doubled data?

Usually the code is installed twice, for example through the theme and a plugin. View the page source: the measurement ID should appear only once.

How do I know tracking works?

Open your site and find your visit in the GA4 real-time report. Then submit a test enquiry and check the event shows up once.

Should I link GA4 to Search Console?

Yes. You will see Google search queries and landing pages alongside visitor behaviour on your site.

Let’s look at your task for free

Leave your contact — in a 15-minute call we’ll show where leads get lost and what to fix first.