Almost every website on the web uses Google Analytics for collecting traffic data and analyzing user behavior. Google shutdown the old Universal Analytics tracking method and launched a new way of data collection using Google Analytics 4 version. If you are still using UA- code on your site, it’s time to create a new GA 4 code and replace the old code with new tracking code. For any new website, you should create new GA 4 account and property for data collection as explained in this article.
UA and GA 4
The Universal Analytics had a tracking code in the format UA-1234xxxxx-1. However, the latest GA 4 has a measurement ID something like in the format G-SSHxxxxxxx. Some website building platforms allow you to insert only the measurements ID while you need to insert the complete Google tag between header section on most cases.
Creating New GA 4 Account and Property
- Go to Google Analytics website and login with your Google account.
- Go to “Admin” section from the left sidebar menu items and then click on “+Create Account” button.
- This will open a wizard showing different steps. The first step is to fill the name for your account, select data sharing options and click “Continue” button.
- Second step is to create a property under the account. Enter the name for your property, select time zone and currency. As of now, you will still see “Create a Universal Analytics property” option under “Advanced options” section. Make sure this option is disabled as it will be removed soon or later and click “Next” button.
- Next step is to select your industry and number of people in your business. You can just select 1-10 if you are managing a blog yourself and click “Next” button.
- Select your business objectives in the next step. You have options to select Generate leads, Drive online sales, Raise brand awareness, Examine user behavior and Get baseline reports. The first four options can be selected together or in any combination which is the ideal selecting in most cases. Here, you should be careful as selecting “Get baseline reports” option can’t be combined with others. Also, this option will disable options in the next step. Let’s select “Get baseline reports” option and click “Create” button to show how it works.
- You will be prompted to accept the terms to create an account/property. Make sure to select the correct country, read the terms and click “I Accept” button.
- The final step is to configure the data collection for your new GA 4 account/property. As you can see, all Web / Android app / iOS app options are greyed out because “Get outline reports” option was selected in previous step. Do not worry and click “Skip for now” button.
- You will see a success message showing the setup is finished and you need to setup a data collection before starting using the tracking code.
Setup Data Collection in Google Analytics 4
Click on the “Set up data collection” button which will take you to “Data streams” section of your newly created GA 4 property of the admin area.
Select “Web” button you will see a configuration screen for setting up data stream. Type your correct website URL and name in the text boxes and turn on “Enhanced measurement” option.
By default, Google will select some measurement options like page views, scrolls, outbound clicks, etc. For adding additional measurements, click the gear icon and turn on the options that you need.
For example, you can add “File downloads” or “Site search” option if required or enable all items and click “Save” button. This will create a measurement ID and stream ID for your property. Click on “View tag instructions” option showing at the last to get the complete Google tag.
Google will automatically scan your site and suggest options for installing the Google tag. For example, you will see recommended plugins like Site Kit to setup GA 4 in WordPress. You can also click on “Scan” link to recheck your site or click “Choose another” link to select a different platform from the list.
“Choose another” option will show a list of platforms including BigCommerce, Wix, GoDaddy, Squarespace, etc. Select the platform to get the instructions to install GA 4 tag on that platform.
For installing the code manually, go to “Install manually” tab and copy the complete Google tag.
You should insert this code between <head> and </head> tags on each page of your site. The complete Google tag code is shown below for your reference and make sure to change the measurement ID of your site in two highlighted places.
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SSxxxxxxxx"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-SSxxxxxxxx');
</script>
Testing Data Flow
After adding GA4 code in your site, go to “Admin” section and select your GA 4 account from the dropdown. The property’s “Data Streams” section should show “Receiving traffic in past 48 hours” indicating GA 4 is added properly in your site.
Click on the “Data Streams” option and you will see a notification on the top mentioning “Data collection is active in the past 48 hours”. You should also see “Data flowing” in a green label in “View tag instructions” section.
If you do not find these details, open the source code of your website in Chrome or another browser. Check the code contains Google tag in the header section. If everything looks fine, wait some time for the changes to reflect in Google Analytics account.
Leave a Reply
Your email is safe with us.