Step 1: Create a new Google Analytics 4 property
- Login to your Google Analytics account
- Click on the "Admin" tab
- In the second column "Property" click on "Create Property"
- Select "Web" or "App", depending on what you want to track
- Follow the prompts to enter the necessary information required, including the website or app name and URL
Step 2: Install the Google Analytics 4 Tracking Code
- Find the "Measurement ID" located in the "Property" column of your newly created web or app property
- Add the following tracking code to your website or app:
<script async src="https://www.googletagmanager.com/gtag/js?id=MEASUREMENT_ID"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'MEASUREMENT_ID'); </script>
Replace "MEASUREMENT_ID" with your unique measurement ID.
Step 3: Set up Event Tracking
- GA4 uses event-based tracking, which means that you need to define what constitutes as an event on your website or app
- Decide what events are important to track on your website or app, such as clicks on specific buttons or links, form submissions, or video plays
- Use the event parameters in GA4 to set up event tracking for each event
Step 4: Import Data from Existing Universal Analytics Property (Optional)
- If you have an existing Universal Analytics property, you can import data from it into your new GA4 property
- Go to "Data Streams" under your property settings and click on "Set up data import"
- Choose the Universal Analytics property you want to import data from and select the views you want to import
Step 5: Test and Verify Data Collection
- Use Google Analytics Debugging tools to test if the data is being collected properly
- Check that events are being tracked accurately and in the expected locations
- Verify that the events are appearing in your GA4 property in the correct reporting area
Congratulations! You have now successfully migrated to Google Analytics 4.
Remember to continue tracking and optimizing your website or app to improve performance, and if you need any assistance feel free to reach out.