Google Analytics 4 (GA4) is the latest version of Google's analytics platform. This guide covers how to install GA4 on your Carrd site using the Embed element.
Prerequisites
Before installing GA4 on Carrd, you need:
- A Carrd Pro account (Pro Lite, Pro Standard, or Pro Plus)
- A Google Analytics 4 property - Create one in Google Analytics
- Your GA4 Measurement ID (format:
G-XXXXXXXXXX) - A published Carrd site (tracking only works on published sites)
Note: GA4 tracking is not available on free Carrd accounts because custom code requires Carrd Pro.
Step 1: Get Your GA4 Tracking Code
- Go to Google Analytics
- Select your GA4 property
- Navigate to Admin (gear icon at bottom left)
- Under Property, click Data Streams
- Click your Web data stream
- Click View tag instructions
- Select Install manually
- Copy the Global site tag (gtag.js) code
The code will look like this:
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
Important: Copy the ENTIRE code block including both <script> tags.
Step 2: Add GA4 to Your Carrd Site
Method 1: Using Embed Element (Recommended)
- Open your Carrd site in the editor
- Click the + (Controls) button on the left
- Select General > Embed
- Place the embed element at the top of your page (before any other content)
- Click on the embed element you just added
- In the embed settings, select Code as the embed type
- Paste your GA4 tracking code into the code field
- Click Done
- Click Publish to publish your site
Method 2: Hidden Embed (Cleaner Approach)
For a cleaner implementation that doesn't affect your page layout:
- Add an Embed element as described above
- After pasting the GA4 code, click Style in the embed settings
- Add this CSS to hide the embed:
display: none;
- Click Done
- Click Publish
This keeps your tracking code hidden and doesn't create any visible elements.
Step 3: Verify Installation
Using GA4 Realtime Reports
- Publish your Carrd site (tracking doesn't work in preview mode)
- Go to Google Analytics
- Select your GA4 property
- Navigate to Reports > Realtime
- In a new browser tab, visit your published Carrd site
- Return to GA4 Realtime - you should see your visit appear within 30 seconds
Using Browser Developer Tools
- Open your published Carrd site (not preview)
- Press F12 to open Developer Tools
- Go to the Network tab
- Filter by
collectorgoogle-analytics - Reload the page
- Look for requests to
https://www.google-analytics.com/g/collect
If you see these requests, GA4 is working correctly.
Using Google Tag Assistant
- Install Google Tag Assistant Chrome extension
- Visit your published Carrd site
- Click the Tag Assistant icon
- Verify that GA4 tag is firing
- Check that the Measurement ID is correct
Configuration Options
Enhanced Measurement
GA4's Enhanced Measurement automatically tracks common interactions. Configure in Google Analytics:
- Go to Admin > Data Streams
- Click your web stream
- Click Enhanced measurement
- Toggle specific automatic events:
- Scrolls: Tracks 90% scroll depth (useful for Carrd's one-page design)
- Outbound clicks: Tracks clicks to external links (important for Carrd)
- Site search: Not applicable for most Carrd sites
- Video engagement: Tracks embedded YouTube videos
- File downloads: Tracks PDF and file downloads
Recommended for Carrd:
- ✓ Enable Scrolls (measure engagement on one-page layouts)
- ✓ Enable Outbound clicks (track clicks to external links)
- ✓ Enable File downloads (if you have downloadable files)
- ✗ Disable Site search (most Carrd sites don't have search)
Custom Configuration Parameters
Modify the gtag('config') call to customize GA4 behavior:
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX', {
'cookie_domain': 'yourdomain.com',
'cookie_expires': 63072000, // 2 years in seconds
'anonymize_ip': true,
'send_page_view': true
});
</script>
Useful parameters for Carrd:
cookie_domain: Set to your custom domaincookie_expires: Cookie lifetime (default is 2 years)anonymize_ip: Anonymize IP addresses for privacysend_page_view: Control automatic page view tracking
Debug Mode
Enable debug mode to see GA4 events in real-time during testing:
<script>
gtag('config', 'G-XXXXXXXXXX', {
'debug_mode': true
});
</script>
View events in Admin > DebugView in GA4.
Remember: Remove debug_mode: true before going to production.
Carrd-Specific Considerations
Single-Page Tracking
Carrd sites are one-page by design, which affects GA4 tracking:
- One page view per visit: Users don't navigate between pages
- Scroll depth is critical: Use scroll tracking to measure engagement
- Section tracking: Consider tracking scrolls to different sections
- Time on site: More important metric than page views
- Exit tracking: Track outbound link clicks to measure conversions
Preview vs. Published
Important difference:
- Preview mode: GA4 does NOT fire in Carrd's preview mode
- Published site: GA4 ONLY works on your published site
Always test GA4 on your published Carrd site, not in preview.
Custom Domain vs. Carrd Subdomain
GA4 works on both:
- Carrd subdomain:
yoursite.carrd.co(works immediately after publishing) - Custom domain:
yourdomain.com(works after DNS propagates)
If testing on a custom domain, ensure DNS is fully configured.
Mobile-First Design
Carrd is optimized for mobile, so verify GA4 works on mobile:
- Publish your Carrd site
- Visit on a mobile device
- Check GA4 Realtime reports
- Verify mobile traffic appears
Most Carrd site visitors will be mobile users.
Performance Impact
GA4 is lightweight, but consider:
- Baseline: Carrd sites are extremely fast (95+ PageSpeed scores)
- GA4 impact: Minimal (~5-10KB), loads asynchronously
- Total impact: Usually <0.1s additional load time
- Recommendation: GA4 is worth the minimal performance cost
Troubleshooting
GA4 Not Tracking
Problem: No data appears in GA4 Realtime reports.
Solutions:
- Verify Carrd Pro: Ensure you have a Pro plan (Lite, Standard, or Plus)
- Check site is published: GA4 only works on published sites, NOT preview
- Verify Measurement ID: Format must be
G-XXXXXXXXXX(not UA- or GTM-) - Check embed placement: Embed should be at top of page
- Clear cache: Hard reload browser (Ctrl+Shift+R)
- Disable ad blockers: Test with ad blockers and privacy extensions disabled
- Wait 24-48 hours: Standard reports can take up to 48 hours to populate
Tracking Works on Carrd Subdomain But Not Custom Domain
Problem: GA4 works on yoursite.carrd.co but not yourdomain.com.
Solutions:
- Wait for DNS propagation: Custom domains can take 24-48 hours to fully propagate
- Verify domain connection: Check that custom domain is properly connected in Carrd settings
- Update cookie domain: Set
cookie_domainparameter in GA4 config - Clear browser cache: Hard refresh on custom domain
- Test in incognito: Use private browsing to avoid cache issues
Events Not Appearing in GA4
Problem: Page views work, but custom events don't appear.
Solutions:
- Check event syntax: Ensure proper
gtag('event', 'event_name')format - Wait for processing: Events can take a few minutes to appear in Realtime
- Use DebugView: Enable debug mode to see events immediately
- Verify embed order: Event tracking embeds should come AFTER GA4 installation embed
- Check JavaScript errors: Open browser console (F12) and look for errors
Duplicate Page Views
Problem: Seeing double page views in GA4.
Causes:
- GA4 installed multiple times in different embeds
- GA4 in both GTM and direct embed
Solutions:
- Search all embeds: Check if GA4 code appears in multiple embed elements
- Check GTM: If using GTM, remove direct GA4 installation
- Choose one method: Either direct installation OR GTM, not both
Advanced Setup
Consent Mode
Implement cookie consent before loading GA4:
<!-- Consent mode implementation -->
<script>
// Set default consent state
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
'analytics_storage': 'denied',
'ad_storage': 'denied'
});
// Update consent when user accepts
function grantConsent() {
gtag('consent', 'update', {
'analytics_storage': 'granted',
'ad_storage': 'granted'
});
}
</script>
<!-- Then load GA4 -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
Call grantConsent() when user accepts cookies.
User ID Tracking
Track logged-in users across sessions:
<script>
// Set user ID (if you have user authentication)
gtag('config', 'G-XXXXXXXXXX', {
'user_id': 'USER_ID_HERE'
});
</script>
Privacy note: Only use User ID tracking with proper consent and privacy disclosures.
Custom Dimensions
Set custom dimensions for Carrd-specific data:
<script>
gtag('config', 'G-XXXXXXXXXX', {
'custom_map': {
'dimension1': 'page_type',
'dimension2': 'user_type'
}
});
// Send custom dimension data
gtag('event', 'page_view', {
'page_type': 'landing_page',
'user_type': 'visitor'
});
</script>
Configure custom dimensions in Admin > Custom Definitions in GA4 first.
Multiple Carrd Sites
If you manage multiple Carrd sites:
Option 1: Separate Properties
Create a separate GA4 property for each site:
- Pros: Isolated data, easier to manage individually
- Cons: Must switch between properties to view data
- Best for: Completely different projects or clients
Option 2: Single Property with Data Streams
Use one GA4 property with multiple data streams:
- Pros: All data in one place, cross-site analysis
- Cons: Need to filter data by site
- Best for: Related sites or personal portfolio of projects
Option 3: Single Property with Custom Dimensions
Use one GA4 property and custom dimensions to identify sites:
<script>
gtag('config', 'G-XXXXXXXXXX', {
'custom_map': {'dimension1': 'site_name'}
});
gtag('event', 'page_view', {
'site_name': 'Portfolio Site'
});
</script>
- Pros: Unified reporting, flexible filtering
- Cons: Requires custom dimension setup
- Best for: Portfolio of similar sites
Privacy and Compliance
GDPR Compliance
For EU visitors:
- Obtain consent before loading GA4
- Anonymize IP addresses: Set
anonymize_ip: true - Update privacy policy: Disclose GA4 usage
- Implement consent banner: Use a cookie consent solution
- Configure data retention: Set appropriate retention in GA4 settings (Admin > Data Retention)
CCPA Compliance
For California visitors:
- Provide opt-out mechanism: Allow users to opt out of tracking
- Update privacy policy: Disclose data collection practices
- Honor opt-out requests: Respect user preferences
Privacy-Focused Alternatives
If privacy is a primary concern:
- Plausible Analytics: Privacy-friendly, GDPR-compliant, simple
- Fathom Analytics: Privacy-first, no cookie banners needed
- Simple Analytics: GDPR-compliant, minimal
All can be installed on Carrd using embed elements.
Next Steps
- Configure Carrd-Specific Event Tracking to track forms, links, and interactions
- Install Google Tag Manager for advanced tag management
- Troubleshoot Tracking Issues if events aren't working
- Optimize Performance to maintain Carrd's fast loading times