Google Analytics
Google Analytics is a powerful web analytics service that helps you track website traffic and user behavior. With the Forge Apps system, you can easily add Google Analytics to your site without manually editing code.
What is Google Analytics?
Google Analytics provides detailed insights about your website visitors, including:
- Traffic Sources: How visitors find your site (search engines, social media, direct links)
- User Behavior: Which pages are most popular, how long visitors stay
- Audience Demographics: Geographic location, device types, browsers
- Conversion Tracking: Monitor goals and e-commerce transactions
- Real-time Data: See current visitors and their activity
Installation
Installing Google Analytics on your Forge site is simple:
1. Access the App Marketplace
Navigate to your site's dashboard and click on the "Apps" section in the sidebar.
2. Find Google Analytics
Browse the available apps or search for "Google Analytics" in the marketplace.
3. Install the App
Click the "Install" button next to Google Analytics. The app will be added to your site immediately.
4. Configure Your Tracking ID
After installation, you'll need to provide your Google Analytics Tracking ID to start collecting data.
5. Deploy Your Site
Important: After configuring the app, you must deploy your site for the Google Analytics code to be injected. The code injection happens during the pre-deploy process.
Getting Your Google Analytics Tracking ID
Before configuring the app, you'll need to set up a Google Analytics property and get your tracking ID:
1. Create a Google Analytics Account
- Go to Google Analytics
- Click "Start measuring" or sign in to your existing account
- Follow the setup wizard to create a new account
2. Create a Property
- In your Google Analytics account, click "Create Property"
- Enter your website name and URL
- Select your industry category and timezone
- Click "Next" to proceed
3. Get Your Tracking ID
- After creating the property, you'll see a tracking ID
- It will look like:
UA-XXXXXXXXX-XorG-XXXXXXXXXX - Copy this tracking ID - you'll need it for the Forge App configuration
Configuration
Once you have your tracking ID, configure the Google Analytics app:
Required Settings
Tracking ID
Enter your Google Analytics tracking ID (e.g., UA-12345678-9 or G-XXXXXXXXXX).
UA-XXXXXXXXX-X format, while Google Analytics 4 uses G-XXXXXXXXXX format.
Optional Settings
Enhanced Link Attribution
Enable this to get more detailed information about which links users click on your site.
Demographics and Interest Reports
Enable this to collect demographic and interest data about your visitors.
Enhanced Ecommerce
Enable this if you have an e-commerce site to track product performance and sales data.
How It Works
The Google Analytics Forge App automatically injects the necessary tracking code into your site's HTML during deployment. Here's what happens:
1. Code Injection
The app adds the Google Analytics tracking code to the <head> section of your HTML pages.
2. Automatic Tracking
Once deployed, the tracking code automatically begins collecting visitor data and sending it to your Google Analytics account.
3. Real-time Updates
Data appears in your Google Analytics dashboard within a few hours, with real-time data available immediately.
Verifying Installation
After configuring the app, verify that Google Analytics is working correctly:
1. Check Your Site
Visit your website and open the browser's developer tools. Look for Google Analytics requests in the Network tab.
2. Check Google Analytics
In your Google Analytics dashboard, go to "Real-time" â "Overview" to see if your visit is being tracked.
3. Use Google Analytics Debugger
Install the Google Analytics Debugger browser extension to see detailed tracking information.
Common Issues
No Data Appearing
Possible causes:
- Incorrect tracking ID format
- Site not yet deployed after configuration
- Ad blockers preventing tracking
- Wrong Google Analytics property selected
Solutions:
- Double-check your tracking ID format
- Deploy your site to apply changes
- Test with ad blockers disabled
- Verify you're looking at the correct Google Analytics property
Duplicate Tracking
Problem: You already have Google Analytics code manually added to your site.
Solution: Remove any existing Google Analytics code from your HTML files to avoid duplicate tracking.
Wrong Tracking ID
Problem: You're using a tracking ID from the wrong Google Analytics property.
Solution: Create a new property in Google Analytics or use the correct tracking ID for your site.
Best Practices
Privacy Compliance
Ensure your privacy policy mentions Google Analytics tracking and consider implementing cookie consent if required by your jurisdiction.
Regular Monitoring
Check your Google Analytics dashboard regularly to monitor site performance and identify areas for improvement.
Goal Setting
Set up goals in Google Analytics to track important actions like form submissions, downloads, or purchases.
Data Retention
Configure data retention settings in Google Analytics to comply with privacy regulations and manage storage costs.
Updating Configuration
To update your Google Analytics configuration:
- Go to your site's Apps section
- Find Google Analytics in your installed apps
- Click "Configure" to modify settings
- Save your changes
- Deploy your site to apply the updates (required for code injection)
Uninstalling
To remove Google Analytics from your site:
- Go to your site's Apps section
- Find Google Analytics in your installed apps
- Click "Uninstall" to remove the app
- Deploy your site to remove the tracking code
Need Help?
If you encounter issues with Google Analytics:
- Check the Google Analytics Help Center
- Verify your tracking ID format and property settings
- Test with browser developer tools to see tracking requests
- Contact Forge support if the app isn't working as expected
Join the Discussion
Have questions or want to share your experience? Join our community discussion to connect with other developers and get help from the Forge team.
Visit Forum Discussion