{"id":3005,"date":"2022-04-11T16:26:53","date_gmt":"2022-04-11T15:26:53","guid":{"rendered":"https:\/\/www.suisseo.ch\/en\/?p=3005"},"modified":"2022-05-30T16:29:23","modified_gmt":"2022-05-30T15:29:23","slug":"how-to-install-google-analytics-4","status":"publish","type":"post","link":"https:\/\/www.suisseo.ch\/en\/blog\/analytics\/how-to-install-google-analytics-4\/","title":{"rendered":"How to install Google Analytics 4 (GA4)?"},"content":{"rendered":"
As you probably know (if not, we recommend reading our latest article on the end of Universal Analytics), Google has announced that it will be deprecating Universal Analytics starting 1 July 2023. This means that your Universal Analytics properties will completely stop receiving data (hits) starting in early July 2023.<\/p>\n
Google Analytics 4, or \u201cGA4\u201d, will replace its predecessor originally released in 2013.<\/p>\n
If you have a Universal Analytics property and you don’t know how to set up GA4, you are in the right place! Read on.<\/p>\n
Log in to your Google Analytics account and access your Google Analytics account administration settings. Under \u201cProperty Settings\u201d, look for the “Upgrade to GA4” link.<\/p>\n
If you do not yet have a Google Analytics account, you must first create one for free by visiting the official Google Analytics page<\/a>.<\/p>\n If the upgrade option is not available to you, you can click on the \u201cGA4 Setup Assistant\u201d section or click on \u201cCreate Property\u201d to create a new GA4 property.<\/p>\n <\/a><\/p>\n Click the \u201cGet Started\u201d button to begin the setup process with the Google Analytics setup assistant. You will then have several options depending on your current GA configuration.<\/span><\/p>\n <\/a><\/p>\n If you are using the Global Site Tag to implement GA, the assistant will be able to enable data collection with your existing tags.<\/p>\n If you are not using the Global Site Tag, the following steps will show you how to enable data collection using Google Tag Manager (GTM).<\/p>\n Before you can start collecting data, you need to generate a measurement ID for your new GA4 property. The measurement ID is similar to the Universal Analytics ID. Enter the \u201cTag installation\u201d menu. See the green box below.<\/p>\n <\/a><\/p>\n GA4 does not have views like Universal Analytics. Instead, it features data streams. The data stream automatically measures certain events such as scrolls, outbound link clicks, site searches, file downloads, etc. Expand the drop-down list to add a stream and select the item you want to track.<\/p>\n In this example, we are tracking a website, so we’ll select Web.<\/p>\n <\/a><\/p>\n Configure your data stream by entering your website URL and stream name.<\/span><\/p>\n Click on \u201cCreate Stream\u201d when you are finished.<\/span><\/p>\n <\/a><\/p>\n Now that you have your measurement ID, copy it as it is needed to configure the GA4 configuration tag in Google Tag Manager.<\/p>\n <\/a><\/p>\n If you use a particular CMS such as WordPress, Magento, Drupal, etc. and your current version of Google Analytics was installed without going through the Global Site Tag or using Google Tag Manager (GTM) but thanks to a particular plugin, please refer to the documentation provided by the tool in question.<\/p>\n <\/p>\n Connect your free tag management tool Google Tag Manager and click on \u201cAdd new tag\u201d.<\/p>\n <\/a><\/p>\n Select \u201cTag configuration\u201d and choose \u201cGoogle Analytics: GA4 Configuration\u201d as tag type.<\/span><\/p>\n <\/a><\/p>\n Fill in the Measurement ID that is in your new property and that you previously copied and paste this ID into the Measurement ID field as shown in the image below.<\/p>\n Advice:<\/strong> We recommend that you create a constant variable for the measurement ID instead of entering it manually. This will allow you to reference the measurement ID for other tags and avoid inconsistencies in the future.<\/p>\n <\/a><\/p>\n Now that your tag is defined, you need to configure your trigger so that the code is triggered on all pages and click on \u201cSave\u201d to complete the configuration of GA4.<\/p>\n <\/a><\/p>\n You can now test your GA4 tag with the preview mode of your Google Tag Manager by clicking on the \u201cPreview\u201d button.\u00a0<\/span><\/p>\n <\/p>\n <\/a><\/p>\n Enter the URL of your site in the field provided.<\/span><\/p>\n <\/a><\/p>\n You can publish your container to put the new tag online. Remember to publish your container after testing, otherwise your GA4 property will not receive data.<\/p>\n <\/a><\/p>\n <\/a><\/p>\n <\/p>\n Return to Google Analytics to enable confirmation of user data collection. Access the administration settings of your Google Analytics account. Under \u201cData settings\u201d go to the \u201cData collection\u201d section then accept the \u201cconfirmation of user data collection\u201d.<\/p>\n2. Add the tracking code to your website<\/h3>\n
3.Enable data collection in Google Analytics<\/h3>\n