Setting up Google Analytics 4 (GA4) and Google Tag Manager (GTM) is essential for tracking your website’s performance, monitoring traffic, and improving SEO. This guide will take you step-by-step through creating accounts, linking your website, and ensuring tracking is properly configured.
Step 1: Access Google Analytics & Tag Manager
Before we begin, you will need to visit:
- Google Analytics – to set up data tracking.
- Google Tag Manager – to manage and deploy tracking codes.
Step 2: Create a Google Analytics Account (GA4)
- Go to Google Analytics and click Create Account.
- Enter your account name (e.g., "Demo Barbershop").
- Enable data sharing settings (recommended).
- Click Next to proceed to property creation.
Step 3: Set Up Your GA4 Property
- Enter your business name as the property name.
- Select your time zone and currency (⚠️ These cannot be changed later!).
- Click Next and fill in your business details:
- Select your industry category (e.g., Beauty & Fitness).
- Choose the business size (e.g., 1-10 employees).
- Click Next and select your business objectives:
- (e.g., "Leads" and "Traffic").
- Click Create and accept the Terms of Service.
Step 4: Set Up Data Collection for Your Website
- Under "Start Collecting Data", choose Website.
- Enter your website URL (remove
https://from the input field). - Name your data stream (e.g., "Demo Barbershop").
- Click Create & Continue.
Step 5: Retrieve Your GA4 Measurement ID
- After creating the data stream, Google will generate a Measurement ID (e.g.,
G-XXXXXXXXXX). - Copy this ID—you will need it for Google Tag Manager.
📌 Note: Do not install the tracking code manually here. Instead, we will do this through Google Tag Manager for better control.
Step 6: Set Up Google Tag Manager (GTM)
- Go to Google Tag Manager and click Create Account.
- Enter your account name (e.g., "Demo Barbershop").
- For Container Setup, enter your domain name (without
https://). - Select Target Platform: Website and click Create.
- Accept the Terms of Service.
Step 7: Add Google Tag Manager Code to Your Website
After account creation, GTM will generate two pieces of code:
- Head Code – Needs to be added in the
<head>section of your website. - Body Code – Needs to be added right after the
<body>tag.
How to Insert the GTM Code in Captivation Hub
- Open your Captivation Hub account.
- Navigate to your Funnel Editor.
- Go to Settings > Head Tracking Code and paste the Head Code from GTM.
- Scroll to Body Tracking Code and paste the Body Code.
- Click Save.
Step 8: Create a Google Analytics Tag in GTM
- In Google Tag Manager, click New Tag.
- Name the tag GA4 - [Measurement ID] (e.g.,
GA4-G-XXXXXXXXXX). - Click Tag Configuration > Google Analytics: GA4 Event.
- Paste your GA4 Measurement ID in the required field.
- Under Event Name, enter a name (e.g., "Website Traffic").
- Click Triggering and select All Pages (to track visits across your entire site).
- Click Save.
Step 9: Publish & Test Your Setup
- In GTM, click Submit.
- Add a version name and description (optional).
- Click Publish to make it live.
✅ Your tracking setup is now complete!
Step 10: Verify Your GA4 Tracking
- Go to Google Tag Manager > Preview.
- Enter your website URL and click Connect.
- A new window will open showing your funnel.
- If tracking is set up correctly, you will see GA4 Tag Fired under Tags Fired.
Step 11: Check Real-Time Data in Google Analytics
- Go back to Google Analytics.
- Navigate to Admin > Web Stream Details.
- If the tracking is working, you will see real-time data appearing.
- If not, wait 24-48 hours for data to populate.
📌 Tip: If data doesn’t appear immediately, you can force the connection by going to Admin > Debug View in GA4.
Troubleshooting Common Issues
❌ Issue: No data appearing in GA4
✔ Solution: Wait 24-48 hours for Google to process the data.
✔ Solution: Double-check that you copied the correct Measurement ID into GTM.
✔ Solution: Ensure you published changes in Google Tag Manager.
❌ Issue: GA4 tag not firing in GTM Preview Mode
✔ Solution: Ensure you hit "Submit" and "Publish" in GTM.
✔ Solution: Try refreshing the preview window and reconnecting.
Conclusion
Setting up Google Analytics 4 (GA4) and Google Tag Manager (GTM) allows you to track website traffic, monitor user behavior, and optimize your SEO analytics. By following this guide, you have successfully:
✅ Created GA4 and GTM accounts.
✅ Installed tracking codes in Captivation Hub.
✅ Configured Google Tag Manager to send data to GA4.
✅ Verified your setup using real-time tracking.
Comments
0 comments
Article is closed for comments.