Setting up Google Analytics is one of the highest-value 30 minutes you will ever spend on your website. Once it is installed, you stop guessing which pages, campaigns and channels are working, and start seeing it in the data.

The problem with most setup guides is that they stop too early. Installing the tracking code is only half the job. A Google Analytics property that is not measuring conversions, events or keyword data tells you how many people visited, but not whether any of it mattered.
This guide covers the full process for Google Analytics 4 (GA4), the current version of the platform: creating your account, installing tracking on any website (including WordPress), verifying it works, and then configuring the measurement that actually drives decisions. That means key events, conversions, ecommerce, keywords and UTM parameters.
No code knowledge is required for the core setup, and everything here uses the free version of Google Analytics.
What You’ll Need Before You Start
You will need to get set up with the below before you start:
- A Google account (a Gmail address is fine)
- Admin access to your website, or to whoever manages it
That’s it. Google Analytics is completely free for the standard version, which covers everything the vast majority of websites need.
Step 1: Create Your Google Analytics Account
Head to analytics.google.com and sign in with your Google account, then click Start measuring.
You’ll be walked through a short setup flow:
Account name. This sits at the top of the hierarchy and is typically your business or organisation name. One account can hold multiple properties, so if you run several websites, they can all live under one roof.
Property name, time zone and currency. A property is where your website’s data lives. Name it after the site, set your reporting time zone (this affects how daily data is bucketed, so get it right first time), and choose your currency. For UK businesses, that means GMT/London and GBP.
Business details and objectives. Select your industry and business size, then choose your objectives. If you want access to the full set of reports from day one, select Get baseline reports. It cannot be combined with the other options, but it gives you everything rather than a trimmed-down view.
Click Create, accept the terms of service, and your property is live. Now it needs data.
Step 2: Set Up Your Web Data Stream
A data stream is the connection between your website and your GA4 property.
- When prompted to choose a platform, select Web.
- Enter your website URL and a stream name (the site name is fine).
- Leave Enhanced measurement switched on. This automatically tracks page views, scrolls, outbound clicks, site search, video engagement and file downloads without any extra configuration, which gives you a significant head start on your event tracking.
- Click Create stream.
You’ll now see your stream details, including your Measurement ID: a code formatted as G-XXXXXXXXXX. Copy it somewhere handy. Some installation methods ask for this ID rather than the full code snippet.
Step 3: Install Google Analytics on Your Website
This is the step that varies depending on how your site is built. Whichever route you take, the golden rule is to use one installation method only. Installing the tag twice double-counts your page views and quietly corrupts your data from day one.
How to Set Up Google Analytics for a Website (Any Platform)
The universal method is the Google tag: a small JavaScript snippet that goes in the head section of every page.
From your stream details page, click View tag instructions and switch to the Install manually tab. Copy the full code snippet, then paste it immediately after the opening head tag in your site’s template, so it loads on every page.
Where exactly you paste it depends on your platform:
- Wix: Settings, then Custom code, or connect your Measurement ID directly under Marketing Integrations.
- Shopify: Online Store, Preferences, Google Analytics, or via the Google & YouTube channel app, which handles the tag for you.
- Squarespace: Settings, Developer Tools, External API Keys, where you paste the Measurement ID.
- Custom-built sites: Add the snippet to your global header template or layout file.
How to Set Up Google Analytics on WordPress
WordPress users have three options, in order of how much we’d recommend them:
Option 1: a header/footer code plugin (recommended). Install a plugin such as WPCode, go to Code Snippets, then Header & Footer, paste your Google tag into the Header box and save. This keeps the tag independent of your theme, so it survives theme updates and redesigns.
Option 2: an analytics plugin. Plugins such as Site Kit by Google or MonsterInsights connect your site to GA4 through a setup wizard and pull headline reports into your WordPress dashboard. Convenient if you want reporting inside WordPress, though it adds another plugin to maintain, and the dashboard reports are a simplified subset of what GA4 itself offers.
Option 3: editing theme files directly. You can paste the tag into your theme’s header.php, but if you update or switch your theme, the code vanishes with it and your data stops dead. If you go this route, use a child theme. For most sites, though, Option 1 is cleaner.
How to Set Up Google Analytics with Google Tag Manager
If you’re already running Google Tag Manager (GTM), or expect to add more tags later such as Google Ads conversion tracking or remarketing, deploy GA4 through GTM instead of pasting the tag directly:
- In GTM, create a new tag and choose the Google Tag type.
- Enter your GA4 Measurement ID.
- Set the trigger to Initialization, All Pages.
- Preview, test and publish the container.
GTM means one container snippet on your site and every future tag managed from a single interface, with no more editing site code each time your measurement needs change. If you plan to run Google Ads alongside Analytics, this is the setup that scales best (we cover the Ads side in our companion guide to setting up Google Ads conversion tracking).
Step 4: Check That Google Analytics Is Working
Don’t skip this. A surprising number of tracking problems are only discovered weeks later, when the data is already lost.
The fastest check is the Realtime report: open your website in another tab or on your phone, click around a few pages, then look at Reports, Realtime in GA4. You should see yourself appear within about 30 seconds.
For a fuller confirmation, return to your data stream page after 30 minutes or so and look for the message that the stream is receiving traffic. Complete report data takes 24 to 48 hours to populate, so don’t panic at thin numbers on day one.
If nothing appears after 48 hours, the usual culprits are:
- A caching plugin or CDN serving old versions of your pages without the tag
- An ad blocker or browser privacy setting on the device you are testing with
- The tag installed on some templates but not others
- A consent management platform blocking the tag before consent is given. This one is worth checking carefully if your audience is UK or EU-based, as a misconfigured consent banner can silently suppress most of your data.
Step 5: Set Up Conversions in Google Analytics (Key Events)
Here is where most setup guides stop, and where the real value starts.
In GA4, everything is an event, and the events that matter to your business are marked as key events (the term that replaced “conversions” in Google Analytics reporting; you will still see “conversions” used in Google Ads). A key event might be a form submission, a quote request, a newsletter sign-up, a file download or a purchase.
If you are searching for how to set up goals in Google Analytics, this is also your answer: goals were a Universal Analytics feature, and key events are their GA4 replacement.
Marking an Existing Event as a Key Event
If GA4 is already collecting the event (Enhanced measurement captures many automatically):
- Go to Admin, then Events.
- Find the event in the list, for example generate_lead or file_download.
- Toggle Mark as key event.
Creating a New Event for Conversions
For actions GA4 doesn’t track out of the box, such as visits to a thank-you page after a form submission:
- Go to Admin, Events, then Create event.
- Name it something descriptive, such as contact_form_submission.
- Set the matching conditions, for example page_location contains /thank-you.
- Save it, then mark the new event as a key event once it starts collecting data.
A useful discipline: limit your key events to actions with genuine business value. If everything is a conversion, nothing is.
Step 6: Set Up Event Tracking in Google Analytics
Beyond the automatic events, GA4 gives you two routes to richer event tracking:
Enhanced measurement events. These are already running if you left the toggle on in Step 2. Review what is being captured under Admin, Data streams, your stream, and switch off anything you do not need. Site search tracking, for instance, needs your search URL parameter configured correctly to be useful.
Custom events via Google Tag Manager. Use these for anything specific to your site: clicks on a phone number, video plays on a particular page, scroll depth on long-form content. GTM lets you build these with triggers and variables rather than code, then send them to GA4 as named events. Once they are flowing, any of them can be promoted to a key event.
Step 7: Set Up Keywords in Google Analytics
GA4 doesn’t show organic keyword data on its own; that information lives in Google Search Console. Linking the two is a two-minute job and one of the most overlooked steps in any Analytics setup:
- In GA4, go to Admin, Product links, then Search Console links.
- Click Link, choose your verified Search Console property, and select your web data stream.
- Confirm the link.
Then publish the reports: go to Reports, then Library, find the Search Console collection, and toggle it to published. You will now have two new reports directly inside Google Analytics: Queries (the search terms people used to find you) and Google organic search traffic (landing-page performance).
If you haven’t verified your site in Search Console yet, do that first at search.google.com/search-console. Verification via your GA4 tag is one of the supported methods, so the order of operations works neatly.
Step 8: Set Up UTM Parameters in Google Analytics
UTM parameters are tags you append to URLs so GA4 can attribute traffic to specific campaigns. They are essential for measuring email sends, social posts and paid activity properly.
A tagged URL looks like this:
https://www.example.co.uk/guide?utm_source=newsletter&utm_medium=email&utm_campaign=june-roundup
The three core parameters:
- utm_source: where the traffic came from (newsletter, linkedin, google)
- utm_medium: the channel type (email, social, cpc)
- utm_campaign: the specific campaign name (june-roundup, summer-sale)
Build them with Google’s free Campaign URL Builder rather than by hand, and agree naming conventions early. GA4 treats “Email”, “email” and “e-mail” as three different mediums, and inconsistent tagging is the fastest way to make your acquisition reports unreadable. Tagged traffic appears automatically in your Traffic acquisition reports; there is nothing to switch on in GA4 itself.
One rule: never use UTM parameters on internal links within your own site. Doing so resets the visitor’s session and wipes their original source.
Step 9: Set Up Ecommerce in Google Analytics
If you sell online, ecommerce tracking turns GA4 from a traffic tool into a revenue tool, connecting products viewed, items added to basket, checkouts started and purchases completed.
How you implement it depends on your platform:
- Shopify: The Google & YouTube channel app sends ecommerce events to GA4 automatically once connected. This is the simplest route by far.
- WooCommerce: Use a dedicated integration plugin or Google Tag Manager to push ecommerce events into the data layer.
- Custom builds: Your developer implements GA4’s ecommerce events (view_item, add_to_cart, begin_checkout, purchase) with the prescribed parameters via the data layer.
Once events are flowing, the Monetisation reports populate with revenue, average order value and product performance, and the purchase event is treated as a key event automatically.
Quick Reference: Your GA4 Setup Checklist
- Create your Google Analytics account and GA4 property
- Set up a web data stream and copy your Measurement ID
- Install the Google tag: directly, via your platform’s integration, via a WordPress plugin, or through Google Tag Manager (one method only)
- Verify tracking in the Realtime report
- Mark your key events (conversions)
- Review enhanced measurement and add custom events where needed
- Link Google Search Console for keyword data
- Agree UTM conventions for campaign tracking
- Enable ecommerce tracking if you sell online
FAQs About Setting Up Google Analytics
Is Google Analytics free to set up?
Yes. The standard version of GA4 is completely free with no usage charges, and it covers everything most websites need. Google Analytics 360, the enterprise tier, is paid, but it exists for very large organisations with extreme data volumes.
How do I set up a Google Analytics account?
Sign in at analytics.google.com with any Google account, click Start measuring, and follow the account and property creation flow described in Step 1 above. The account itself takes under five minutes; installing the tag on your site is the part that varies.
How long does it take for data to appear?
Realtime data appears within seconds of correct installation. Standard reports take 24 to 48 hours to populate fully, so judge your setup by the Realtime report, not by day-one numbers.
What’s the difference between Google Analytics 4 and Universal Analytics?
Universal Analytics stopped processing data in July 2023 and has been fully retired. GA4 is the only version you can set up today. It uses an event-based data model rather than sessions and pageviews, which is why features like “goals” now exist as key events.
Can I set up Google Analytics without touching code?
Yes. WordPress plugins, Shopify’s native integration, Wix’s marketing integrations and Squarespace’s settings panel all let you connect GA4 with just your Measurement ID, with no code editing required.
Do I need Google Tag Manager as well as Google Analytics?
Not strictly, but if you expect to add conversion tracking, remarketing tags or custom event tracking, GTM saves significant time later. It is also the natural foundation if you plan to run Google Ads, where accurate conversion tracking is everything.