Set up Google Analytics on your website (2026)

5 min read

What you’ll have at the end

A Google Analytics account with a property for your website, a web data stream for your site's address, and the Google tag added to your website so Analytics can start collecting data. The guide ends while you wait for the first data to arrive.

Before you start

You’ll need

  • A Google Account
  • Your website's address (such as example.com)
  • A way to change your website, either its builder or CMS settings, or its code

What it costs. Google describes standard Google Analytics 4 properties as the free version.

You need a Google Account and your website's address.

You also need a way to add the Google tag to your site. There are two common routes, and this guide covers both: - If your site is on a website builder or CMS, such as Wix, Squarespace, Shopify, Google Sites or WordPress.com, it may have its own field for a Google Analytics ID. Google's help lists the platforms that do. - If you or someone you work with edits your site's code, you can paste the Google tag into each page.

If you're not sure which route fits your site, please look in your platform's own help for "Google Analytics" before you start.

Steps

  1. 1. Open Google Analytics

    On a computer, go to analytics.google.com and sign in with your Google Account.

  2. 2. Click Start Measuring

    If this is your first time using Google Analytics, click Start Measuring.

    If you already have an Analytics account and would like a new one, go to Admin, click Create, then select Account. To add a website to an account you already have, select Property instead, and go to step 4.

  3. 3. Name your account

    Enter a name for your account. Below it, choose the data-sharing settings you're comfortable with. These control which data you share with Google. Then click Next.

  4. 4. Name your property

    Enter a name for the property, such as your business name followed by "website". Select your reporting time zone and currency, and click Next.

  5. 5. Describe your business

    Select your industry category and business size, and click Next.

  6. 6. Choose how you'll use Analytics

    Select how you intend to use Analytics. Google uses this to choose your default reports. Click Create.

  7. 7. Accept the terms

    If you're setting up a new account, Google asks you to accept the Analytics Terms of Service and the Data Processing Amendment. Please read them, and accept if you agree.

  8. 8. Click Web

    Google asks which platform you'd like to collect data from. Click Web.

  9. 9. Enter your website and a stream name

    Enter your website's address, such as example.com, and a Stream name, such as your business name followed by "web stream".

    You can turn enhanced measurement on or off here. Google says it collects page views and other events automatically.

  10. 10. Click Create stream

    Click Create stream.

  11. 11. Copy your Measurement ID

    Open your new web stream's details and find your Measurement ID. Google's help says it's in the first row of the stream details. It starts with "G-", followed by letters and numbers. Please copy it.

    If you can't see the stream details, go to Admin, then Data streams, then click your web stream.

    Now please follow step 12 if your site is on a website builder or CMS, or steps 13 to 15 if you're adding the tag to your site's code.

  12. 12. Website builder or CMS: paste the ID into your platform

    Open your website builder or CMS in a new tab. Find its Google Analytics field, paste your Measurement ID, and save. If your platform asks you to publish changes, please publish. Every platform's screens are different. Google's CMS help has instructions for each platform it lists. Then go to step 16.

  13. 13. Site code: click View tag instructions

    Back on your stream details in Analytics, under Google tag, click View tag instructions.

  14. 14. Select Install manually

    On the installation instructions page, select Install manually. Analytics shows a code snippet, your Google tag. Click the copy icon next to it.

  15. 15. Paste the tag into every page

    Paste the entire snippet into the code of every page of your website, immediately after the <head> element. Save and publish your site as you normally do.

    Google asks that you don't add more than one Google tag to each page. If your site already has one, please check with whoever set it up before adding another.

  16. 16. Visit your site and open the Realtime report

    Open your website in a browser. Then, in Analytics, select Reports from the left menu, and click Realtime. Google's Realtime help says this report shows activity during the last 30 minutes.

    Google's setup help says data collection may take up to 30 minutes to begin, and suggests the Realtime report to check that data is arriving. This guide ends here, at the wait.

If something looks different

  • If you don't see Create in Admin, Google's help says you need the Editor role or above.
  • Some screens show Configure tag settings instead of View tag instructions. Google's help says to select Configure tag settings, then click Installation instructions in the Your Google tag section, then Install manually.
  • The installation screen may also offer a way to test your site: enter your website's address and click Test.
  • If you already use Google Tag Manager on your site, Google's help offers adding Analytics through Tag Manager as another route. Its screens differ from these steps.
  • If your platform has no Google Analytics field, Google's CMS help suggests using the platform's custom HTML feature to add the Google tag from step 14.