Set up Analytics for a website and/or app (GA4)

This article is for anyone who wants to set up Analytics (using a Google Analytics 4 property) on a new website or app. If you need to set up a Universal Analytics property instead (e.g. if you need a "UA-" tracking ID instead of a "G-" Measurement ID), read this article instead.

Create an Analytics account

Your first step is to set up an Analytics account, unless you already have one. Skip to creating a property unless you want to create a separate account for this website and/or app. For example, you might want to create another account if this website and/or app belong(s) to a separate business.

  1. In Admin, in the Account column, click Create Account.
  2. Provide an account name. Configure the data-sharing settings to control which data you share with Google.
  3. Click Next to add the first property to the account.

 Create a Google Analytics 4 property

You need Edit permission to add properties to a Google Analytics account. If you created this account, you automatically have Edit permission. You can add up to 100 properties to an Analytics account. To raise this limit, reach out to your account manager. 

To create a property:

  1. Are you continuing from "Create an Analytics account", above? If so, skip to step 2.  Otherwise,
    • In Admin, look at the Account column to make sure that you've selected the right account. Then, in the Property column, click Create Property.
  2. Enter a name for the property and select the reporting time zone and currency. Time zone determines the day boundary for your reports regardless of where the data originates.
    • If you choose a time zone that honors Daylight Savings Time, Analytics automatically adjusts for time changes. Use Greenwich Mean Time if you don't want to adjust for Daylight Savings Time.
    • Changing the time zone only affects data going forward. If you change the time zone for an existing property, you may see a flat spot or a spike in your data, caused by the time shift forwards or backwards, respectively. Report data may refer to the old time zone for a short period after you update your settings, until Analytics servers have processed the change.
  3. Click Next. Select your industry category and business size.
  4. Click Create and accept the Analytics Terms of Service and the Data Processing Amendment.

Add a data stream

  1. Are you continuing from "Create a property", above? If so, skip to step 2.  Otherwise,
    • In Admin, look at the Account column to make sure that you have your desired account selected. Then, look at the Property column to make sure that you have your desired property selected.
    • In the Property column, click Data Streams.
  2. Click Add stream, then click iOS app, Android app, or Web.

    iOS app or Android app

    When you add an app data stream, Analytics creates a corresponding Firebase project and app data stream, and automatically links the Firebase project to your property if your project and property are not already linked. Currently, you cannot link to an existing Firebase project from Analytics.

    1. Enter the iOS bundle ID or Android package name, the app name, and for iOS, the App Store ID, then click Register app.
    2. Click Next and follow the instructions to download the config file for your app.
    3. Click Next and follow the instructions to add the Firebase SDK to your app.
    4. Click Next.
    5. Run your app to verify installation of the SDK and that the app is communicating with Google servers.
    6. Click Finish. (Alternatively, click Skip this step if you want to complete app setup at a later time.)
    Web
    1. Enter the URL of your primary website, e.g., "example.com", and a Stream name, e.g. "Example, Inc. (web stream)".
    2. You have the option to enable or disable enhanced measurement. Enhanced measurement automatically collects page views and other events. Once the data stream has been created, you can always go back and individually disable the enhanced measurement events you don’t want to collect. So, we recommend that you enable enhanced measurement now.
    3. Click Create stream.

Set up data collection (for websites)

You'll need to add the Analytics tag to your web pages to begin seeing data in your new Google Analytics 4 property.

Add the global site tag to a website builder or CMS-hosted website (for example, WordPress, Shopify, etc.)
Don't see a Data Streams option in the Property column? You are looking at a Universal Analytics property instead of the GA4 property that you just created. Use the property selector or Admin to navigate to your new GA4 property.
  1. Click Admin.
  2. In the Property column, check that you have your new Google Analytics 4 property selected, then click Data Streams, then Web. Click the data stream.
  3. Under Tagging Instructions, click Add new on-page tag and look for "Global Site Tag (gtag.js)". Your Analytics page tag is the entire section of code that appears, beginning with:
    <!-- Global Site Tag (gtag.js) - Google Analytics -->
    and ending with
    </script>

Copy and paste your entire Google Analytics page tag to your website using your CMS' custom HTML feature. Follow your CMS' instructions on how to do this below:

It may take up to 30 minutes for data collection to start. You can then use the Realtime report to verify that you're receiving data.

Add the global site tag directly to your web pages

You'll need access to your web pages HTML. Ask your web developer to perform these steps if you're unable to do this yourself.

  1. Click Admin.
  2. In the Property column, check that you have your new Google Analytics 4 property selected, then click Data Streams, then Web. Click the data stream.
  3. Under Tagging Instructions, click Add new on-page tag and look for "Global Site Tag (gtag.js)". Your Analytics page tag is the entire section of code that appears, beginning with:
    <!-- Global Site Tag (gtag.js) - Google Analytics -->
    and ending with
    </script>
  4. Copy and paste your entire Analytics page tag immediately after the <head> on each page of your website.

It may take up to 30 minutes for data collection to start. You can then use the Realtime report to verify that you're receiving data. 

Don't see a Data Streams option in the Property column? You are in a Universal Analytics property instead of the GA4 property that you just created. Use the property selector or Admin to navigate to your new GA4 property.
Add your tag using Google Tag Manager

In Google Tag Manager, create a Google Analytics: GA4 Configuration tag:

  1. Click Tags and then New.
  2. Click Tag Configuration.
  3. Select Google Analytics: GA4 Configuration.
  4. Enter your Measurement ID.
  5. Optional: Add any parameters you'd like to configure in Fields to Set. Use recommended event parameter names for best results.
  6. Optional: Add any custom user properties that you'd like to configure in User Properties. Note: Analytics automatically logs some user properties. You can set up to 25 additional user properties per Google Analytics 4 property.
  7. Optional: Use Advanced Settings to set a Tag Firing Priority or use Tag Sequencing to help ensure that the Configuration tag fires before any other event tags that require it.
  8. Click Triggering and select appropriate triggers that would cause the tag to fire, e.g. "All Pages", so that the configuration tag fires on all pages of your website.
  9. Save the tag configuration and publish your container.
Was this helpful?
How can we improve it?

Need more help?

Sign in for additional support options to quickly solve your issue