#
Google Analytics
Analyze your website data with the world's leading analytics platform.
Measure your website traffic and evaluate the performance of your marketing, content, products, and more with Google Analytics.
#
Prerequisites
- Preexisting website.
- Have a Google Tag Manager account.
#
Installation
Go to Google Analytics and login to your account. If you don't have one, create a new account.
Create a property for your website by following the steps provided.
- Set up your web stream.
Click Create & continue.
Obtain your Google Analytics Measurement ID (for GA4, it starts with "G-") by clicking on your property.
Go to Google Tag Manager and log in.
Select the container for the website where you want to add Google Analytics.
Click on "Tags" in the left sidebar.
Then, click the New button to create a new tag.
Name your tag something descriptive, like "GA4 Configuration".
Choose Tag Configuration and select Google Tag.
Paste your Google Analytics Measurement ID (e.g., G-XXXXXXX) into the appropriate field.
- Click on "Triggering". Choose "All Pages" as the trigger to fire this tag on every page of your website.
Click Save.
Use the "Preview" mode in Google Tag Manager to check if the tags are firing correctly, or use the Google Tag Assistant extension in your browser to verify the installation.
- Click Publish.
- Copy the code snippet provided.
- Paste it on every page of your website, immediately after the
<head>
element.