This article is for website owners who are using Universal Analytics and want to try out a GA4 property.
Learn more about GA4 properties and the next generation of Analytics
Use the GA4 Setup Assistant (instructions below) to create a new GA4 property that collects data in parallel with your existing Universal Analytics property. There are no changes to your Universal Analytics property and it continues to collect data as always. You can always access both properties via the property selector or Admin screen.
If you use a website builder or your site is hosted on a Content Management System (CMS) (for example, Hubspot, Magento, Squarespace, etc.) that doesn't already use gtag.js, follow these instructions for your particular CMS. and do not simply paste your "G-" ID into the field that your CMS provides.
The GA4 Setup Assistant wizard does not backfill your new GA4 property with historical data. Your GA4 property only collects data going forward. To see historical data, use the reports in your Universal Analytics property.
GA4 Setup Assistant wizard
Follow the instructions below to create your GA4 property. The instructions are the same regardless of whether your website pages have a Google Analytics tag (gtag.js or analytics.js) or a Google Tag Manager container. To use the GA4 Setup Assistant, you need Editor role for the account.
- In Google Analytics, click
Admin (lower left).
- In the Account column, make sure that your desired account is selected. (If you only have one Google Analytics account, it will already be selected.)
- In the Property column, select the Universal Analytics property that currently collects data for your website.
- In the Property column, click GA4 Setup Assistant. It is the first option in the Property column.
- Click Get started under I want to create a new Google Analytics 4 property.
- Click Create Property.
Once you click Create Property, the setup wizard:
- Creates your new GA4 property.
- Copies the property name, website URL, timezone, and currency settings from your Universal Analytics property.
- Activates enhanced measurement in your GA4 property.
- Creates a connection between your Universal Analytics and GA4 properties. This connection makes it possible for you to use Setup Assistant in your Google Analytics 4 property to migrate configurations from your Universal Analytics property to your GA4 property.
- (If your site is tagged with gtag.js and you elected to Enable data collection using your existing tags in Step 6 above) Creates a connected site tag between your Universal Analytics and GA4 properties.
Once this process is complete, you will see "You have successfully connected your properties" at the top of your Google Analytics 4 Property Setup Assistant page.
Make a note of your GA4 property's name so you can find it later. If your Universal Analytics property name is "Example property (UA-nnnnnnn)", your GA4 property name will be "Example property (xxxxxxx)", without a "UA-" prefix, and where xxxxxxx is a new property number. Click See your GA4 property to open Setup Assistant in your new GA4 property.
If the setup wizard did use your existing tagging
If the GA4 Setup Assistant wizard provided the option to Enable data collection using your existing tags (and you left this option selected), your new GA4 property should now be collecting data.
It can take up to 30 minutes for data to begin appearing in your new GA4 property.
To verify that data is being collected, browse your website, then select Realtime from the report navigation. You should see activity in the Realtime report.
If you have an existing Firebase project, you can link this GA4 property to it. However, you have to do this from Firebase. Learn how.
If the setup wizard did not use your existing tagging
If you tagged your site with analytics.js (instead of gtag.js) or if you use a website builder/CMS that tags your pages with analytics.js, then the GA4 Setup Wizard was not able to reuse your existing tagging.
If you're not using a website builder/CMS, you or your web developer can use whatever page editor you like to add the GA4 gtag.js tag directly to your pages. Leave the analytics.js tag in place so that Analytics still sends data to your Universal Analytics property.
If you're using a website builder/CMS that tags your pages with analytics.js, you can use the custom-HTML feature to add the GA4 gtag.js tag to your pages. Leave the analytics.js tag in place so that Analytics still sends data to your Universal Analytics property.
Find your GA4 on-page tag
Your new GA4 on-page tag is located on the details page for the web data stream for your GA4 property. If you don't see a Data Streams link in the Property column, you are looking at the Admin page for a Universal Analytics property instead of your new GA4 property.
- Click
Admin (lower left).
- In the Property column, check that you have your new GA4 property selected, then click Data Streams, then Web. Click the data stream.
- Under Tagging Instructions, click Add new on-page tag > 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>
If you or your web developer are manually tagging your web pages
Copy and paste your entire Analytics page tag immediately after the <head> tag on each page of your website.
Don't remove the old analytics.js tag; it will continue to collect data for your Universal Analytics property. The gtag.js tag that you're adding will collect data for your new GA4 property.
Use the Realtime report to verify that you're receiving data.
If you are using a website builder/CMS
If your website builder/CMS is already using gtag.js, the setup wizard should offer the option to reuse your existing tags. If you don't have that option, then add your GA4 on-page tag as custom HTML.
The following table lists website builders / CMSes that use analytics.js and require that you add your GA4 on-page tag as custom HTML in order to have both tags on your site.
Copy and paste your entire Google Analytics page tag to your website using your CMS's custom HTML feature.
Use the Realtime report to verify that you're receiving data.
Website builder / CMS | Options to add custom HTML |
---|---|
Blogger | Instructions |
Cart.com | Contact Cart.com support for instructions |
Hubspot | Instructions |
Magento | Instructions |
One.com | Contact One.com support for instructions |
Salesforce (Demandware) | Contact Salesforce support for instructions |
VTEX | Contact VTEX support for instructions |
Weebly | Instructions |
If you 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.