Skip to main content

Step 1: Set up Google Analytics on your website

Follow this step-by-step guide to create a free Google Analytics 4 account and add the GA4 tracking code to your website in about 20 minutes.

D
Written by Deniz Ozakar

Time needed: about 20–25 minutes

What you’ll need: a Google account (a normal Gmail address is fine), and the ability to log in to your website’s admin/settings area

Before you start

This step gets Google Analytics live on your website — from nothing, to actually counting visitors. It’s two short parts done back to back: first you create a free account (Google’s way of saying “this website belongs to me, please start counting visitors for it”), then you place a small snippet of code on your site so it can actually start watching. You will not be writing any code yourself — just copying and pasting text Google gives you.

Part 1: Create your Google Analytics account

1. Go to analytics.google.com and sign in with your Google account (the same kind you’d use for Gmail).

Google Analytics sign-in screen

2. Click the blue Start measuring button.

3. You’ll be asked to name your Account. This is just a label — use the name of your business, e.g. “Riverside Museum.” Leave the other checkboxes as they are unless you know you want to change them. Click Next.

GA4 property creation screen

4. Now you’ll name your Property — this is just another label, for your specific website. Use something like “Riverside Museum – Website.” Also set: - Time zone — where your venue is located - Currency — the currency you sell tickets in

These matter because your sales numbers will later be shown using this currency and time zone. Click Next.

GA4 property creation screen with name, time zone, and currency filled in

5. Pick your industry category (e.g. “Arts & Entertainment”) and business size. This just helps Google show you more relevant tips later — it doesn’t affect your data. Click Next.

6. You’ll see a list of business objectives — these are just checkboxes for what you’re hoping to learn. For a ticketing website, tick “Examine user behavior” and/or “Generate leads.” You can change this anytime. Click Create.

GA4 business objectives checklist, “Drive sales” selected

7. Accept the Google Analytics Terms of Service when prompted (tick the boxes, click I Accept).

8. Last step: create a data stream. Choose Web (since this is a website, not a mobile app). Enter: - Your website address (e.g. https://www.riversidemuseum.com) - A stream name — you can just call it “Main website”

Click Create stream.

GA4 “Set up data stream” screen with website URL and stream name entered

After the last click, Google Analytics shows you a code that looks like this: G-XXXXXXXXXX

This is your website’s unique ID number inside Google Analytics — like a membership number. You’ll need it for Part 2 below, and again in the next article, so keep this tab open or write it down somewhere safe.

GA4 Web stream details panel with the Measurement ID highlighted

Tip: Lost this number later? You can always find it again: go to the gear icon (Admin) → Data Streams → click your website’s stream.

Part 2: Add the tracking code to your website

Creating the account above doesn’t actually start counting anything yet — it’s like getting a security camera but not plugging it in. This part “plugs it in” by placing that snippet on your website.

If your web agency or developer already set up “Google Tag Manager” on your site, skip this part and go straight to Using Google Tag Manager instead — you don’t need both.

If you’re not sure how to edit your website, that’s completely normal. Two options:

  • If someone else built your website (an agency, freelancer, or colleague), forward them this article — this part takes them a few minutes.

  • If you manage your own site through a website builder (like WordPress, Squarespace, or Wix), follow Option A below — most of these have a simple settings field for this.

Option A — Your website builder has a built-in field (easiest)

Many website builders have a dedicated spot for this, so you never touch code at all.

1. Log in to your website’s admin area.

2. Look for a settings menu called something like “Analytics,” “Tracking Code,” or “Header/Footer Code.” - WordPress: if you don’t see a built-in option, install a free plugin called “Insert Headers and Footers” or “WPCode” (search for it under Plugins → Add New). This gives you the field you need.

WordPress plugin search showing “Insert Headers and Footers” or WPCode

3. Now go get the snippet from Google Analytics: go back to analytics.google.com → gear icon (Admin) → Data Streams → click your website’s stream → View tag instructions. - If the field you found in step 2 only asks for an ID, copy the Measurement ID (G-XXXXXXXXXX) shown at the top — that’s all you need, skip to step

4. - If the field asks for a full code snippet, click Install manually and copy the whole block shown. It looks like this:

<!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script> <script>   window.dataLayer = window.dataLayer || [];   function gtag(){dataLayer.push(arguments);}   gtag('js', new Date());   gtag('config', 'G-XXXXXXXXXX'); </script>

4. Go back to the field you found in step 2, and paste in whichever one it was asking for — just the ID, or the full snippet.

Header code field with the snippet pasted in

5. Click Save (and Publish/Update if your site asks you to separately publish changes).

Option B — Manual install (if Option A doesn’t apply to you)

1. In Google Analytics, click the gear icon (Admin) at the bottom left.

2. Click Data Streams → click your website’s stream → View tag instructionsInstall manually.

GA4 “View tag instructions” and “Install manually” screens

3. Copy the code block shown on screen.

4. Send it to whoever manages your website’s code, with the instruction: “Please paste this right before the </head> tag on every page.”

How to check it actually worked

This is the reassuring part — you can see it happen live.

1. Open your website in a new browser tab (just visit it like a normal customer would).

2. Go back to Google Analytics and click Reports (left sidebar) → Realtime.

3. Within about 30 seconds, you should see “1” appear under active users — that’s you, visiting your own site!

GA4 Realtime report showing 1 active user

If you don’t see anything after a minute or two: - Double check you saved/published your website changes (not just clicked away from the page) - If your site has a cookie consent pop-up, make sure you clicked “Accept” on it while testing - Try refreshing the Realtime report page

Next step

Did this answer your question?