This article is about Google Analytics 4 properties. Refer to the Universal Analytics section if you're still using a Universal Analytics property, which will stop processing data on July 1, 2023 (October 1, 2023 for Analytics 360 properties).

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

Discover how to set up Google Analytics for your website or app by creating a Google Analytics 4 property and adding a data stream.
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 new Google Analytics 4 property

You need the Editor role to add properties to a Google Analytics account. If you created this account, you automatically have the Editor role. 

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, contact your support representative. 

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.
    • We recommend that you change the time zone for a property no more than once per day so Analytics can process 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,
    1. 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.
    2. In the Property column, click Data Streams > 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 Google Analytics for 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 (e.g., WordPress, Shopify, etc.)

Google Sites, Wix, WooCommerce, and Wordpress.com

If you are using Google Sites, Wix, WooCommerce, or Wordpress.com, follow the instructions below to find your "G-" ID and paste it into the Google Analytics field that your CMS provides.

 To find your "G-" ID:

  1. Sign in to your Google Analytics account.
  2. Click Admin.
  3. At the top of the Property column, select your property.
  4. In the Property column, click Data streams.
  5. Click the data stream for your website.
  6. Your "G-" ID appears in the top right.Measurement ID in the Web stream details pane

Enter your "G-" ID into the field that your CMS provides:

All other website builders

If you are using a CMS or website builder other than Google Sites, Wix, WooCommerce, or Wordpress.com, you'll need to paste your Google tag into your website using your CMS's custom HTML feature.

  1. Sign in to your Google Analytics account.
  2. Click Admin.
  3. At the top of the Property column, select your property.
  4. In the Property column, click Data streams > Web.
  5. Click the data stream for your website.
  6. Under Google tag, click View tag instructions.
  7. On the Installation instructions page, select Install manually:
    • On the screen, you’ll see the JavaScript snippet for your account's Google tag. Your Google tag is the entire section of code that appears, beginning with:

      <!-- Google tag (gtag.js) -->

      and ending with

      </script>

Paste your Google tag to your website using your CMS's custom HTML feature. Follow your CMS's instructions on how to do this below:

  • Awesome Motive: Contact Awesome Motive support for instructions.
  • Blogger instructions
  • Cart.com: Contact Cart.com support for instructions.
  • Drupal: Contact Drupal support for instructions.
  • Duda instructions
  • GoDaddy instructions
  • HubSpot instructions
  • Magento instructions
  • One.com: Contact One.com support for instructions.
  • PrestaShop: Contact PrestaShop support for instructions.
  • Salesforce (Demandware): Contact Salesforce support for instructions.
  • Shopify instructions
  • Site Kit: Contact Site Kit support for instructions.
  • Squarespace instructions (only available to users who have a "Business and Commerce" plan)
  • TYPO3: Contact TYPO3 support for instructions.
  • VTEX: Contact VTEX support for instructions
  • Weebly instructions

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

Add the Google tag directly to your web pages

You need access to the HTML for your web pages. Ask your web developer to perform these steps if you're unable to complete the steps yourself.

  1. Sign in to your Google Analytics account.
  2. Click Admin.
  3. At the top of the Property column, select your property.
  4. In the Property column, click Data streams > Web.
  5. Click the data stream for your website.
  6. Under Google tag, click View tag instructions.
  7. On the Installation instructions page, select Install manually:
    • On the screen, you’ll see the JavaScript snippet for your account's Google tag. Your Google tag is the entire section of code that appears, beginning with:

      <!-- Google tag (gtag.js) -->

      and ending with

      </script>

Paste your Google tag immediately after the <head> on each page of your website.

Data collection may take up to 30 minutes to begin. 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

For basic data collection, follow the Google Tag Manager help center instructions to add the Google Analytics: GA4 Configuration tag.

Find your "G-" ID (for any platform that accepts a "G-" ID)

If you want to use Google Analytics on a service or platform that accepts a "G-" ID, follow these instructions to find your "G-" ID. Then, enter your "G-" ID in the field that your service or platform provides.

 To find your "G-" ID:

  1. Sign in to your Google Analytics account.
  2. Click Admin.
  3. At the top of the Property column, select your property.
  4. In the Property column, click Data streams.
  5. Click the data stream for your website.
  6. Your "G-" ID appears in the top right.Measurement ID in the Web stream details pane
Was this helpful?
How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
Search Help Center
true
69256
false
false