[GA4] Set up Analytics for a website and/or app

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 a "UA-" tracking ID, read this article instead.
Do you have multiple websites and/or apps? Learn how to structure your Analytics account.

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 (any combination of Universal Analytics and Google Analytics 4 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 (e.g. "My Business, Inc website") and select the reporting time zone and currency. If a visitor comes to your website on a Tuesday in their time zone, but it's Monday in your time zone, the visit is recorded as having occurred on Monday.
    • 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 then Add stream.
  2. 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.

You can link to an existing Firebase project, however you have to do this from Firebase (and for a GA4 property that is not yet linked with Firebase.) Learn how.
  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 tag to a website builder or CMS-hosted website (for example, WordPress, Shopify, etc.)

Drupal or WooCommerce

If you are using Drupal or WooCommerce, find your "G-" ID and paste it into the Google Analytics field that your CMS provides:

  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.
    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.
  3. Your "G-" ID appears at upper right. Enter your "G-" ID into the field that your CMS provides. (WooCommerce instructions)

All other website builders

If you are using a CMS or website builder other than Drupal or WooCommerce, you'll need to paste the entire global site tag into your website using your CMS' custom HTML feature. First, find your global site tag:

  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.
    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.
  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?