[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, adding a data stream, and adding your Google Analytics code.
Note: The previous link opens to the last Analytics property you accessed. You can change the property using the property selector.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. Go to https://analytics.google.com.
  2. In Admin, click Create, then select Account.
    Note: The previous link opens to the last Analytics property you accessed. You can change the property using the property selector. You must be a Viewer or above at the account level to create an Analytics account.
  3. Provide an account name. Configure the data-sharing settings to control which data you share with Google.
  4. Click Next to add the first property to the account.

  Get insights on your website or app, at no cost

Use Google Analytics to understand the full customer journey, from first visit to purchase.

 

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 2,000 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, click Create, then select 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 Next. Select how you intend to use Google Analytics.
    • Google Analytics tailors the set of default reports based on the information you provide about how you intend to use Analytics. For example, if you choose "Generate more leads," you will see a collection of reports to help you measure lead generation. Learn more about the business objectives reports collection.
  5. Click Create and (if you are setting up a new account) accept the Analytics Terms of Service and the Data Processing Amendment.
  6. Continue to Add a data stream to start collecting data.

Add a data stream

  1. Are you continuing from "Create a property", above? If so, skip to step 2. Otherwise,
    1. In Admin, under Data collection and modification, click Data Streams.
      Note: The previous link opens to the last Analytics property you accessed. You can change the property using the property selector. You must be an Editor or above at the property level to add a data stream.
    2. Click 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.

 

Measure user activity with recommended events in Google Analytics

For subtitles in your language, turn on YouTube captions. Select the settings icon Image of YouTube settings icon at the bottom of the video player, then select "Subtitles/CC" and choose your language.


 
Watch a step-by-step video to see how to set up Google Analytics on your website using Google Tag Manager.

Set up data collection for websites

To begin seeing data in your new Google Analytics 4 property, you'll need to do one of the following:

Add the tag to a website builder or CMS-hosted website (e.g., HubSpot, Shopify, etc.)

See if your CMS lets you enter just your Google tag ID

Many CMSs have native integrations with Google Analytics 4. If you're using one of the CMSs listed below, follow the instructions to find your Google tag ID and paste it into the Google Analytics field that your CMS provides.

 To find your Google tag ("G-") ID:

  1. In the Property column, click Data streams.
  2. Click the data stream for which you need the ID.
  3. In the Google tag section, click Configure tag settings.
  4. In the Your Google tag section, copy the ID that starts with "G-" or "AW-".

Enter your Google tag ID into the field that your CMS provides:

All other website builders

If you are using a CMS or website builder that doesn't provide a field to enter your Google tag ID, you'll need to paste your Google tag into your website using your CMS's custom HTML feature.

 
  1. In Admin, under Data collection and modification, click Data streams.
    Note: The previous link opens to the last Analytics property you accessed. You can change the property using the property selector.You must be an Editor or above at the property level to create.
  2. Click Web.
  3. Click the data stream for your website.
  4. Under Google tag, click View tag instructions.
  5. 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:

  • Cart.com: Contact Cart.com support for instructions.
  • PrestaShop: Contact PrestaShop support for instructions.
  • Salesforce (Demandware): Contact Salesforce 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. In Admin, under Data collection and modification, click Data streams.
    Note: The previous link opens to the last Analytics property you accessed. You can change the property using the property selector.You must be an Editor or above at the property level to create.
  2. Click Web.
  3. Click the data stream for your website.
  4. Under Google tag, click View tag instructions.
  5. 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.

Next steps

After you have set up data collection, complete additional configurations to get more useful data out of Analytics. Review the checklist to learn which configurations are right for you to collect more data, filter unwanted data, and power advertising.

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Main menu
5781083923415667606
true
Search Help Center
true
true
true
true
true
69256
true
false