Strikingly requires manual code injection to add Google Analytics 4. This guide covers direct GA4 implementation and the recommended GTM approach.
Prerequisites
Before you begin:
- Strikingly Plan: Limited, Pro, or VIP plan (custom code access required)
- GA4 Property: Created in Google Analytics with Measurement ID (G-XXXXXXXXXX)
- Site Access: Admin access to your Strikingly site settings
Note: Free plan users cannot add custom code and must upgrade to use GA4.
Method Comparison
| Method | Difficulty | Flexibility | Recommended For |
|---|---|---|---|
| Direct GA4 Code | Easy | Low | Basic page view tracking |
| Google Tag Manager | Medium | High | Most sites (recommended) |
Method 1: Direct GA4 Implementation
Add GA4 directly to your Strikingly site for basic tracking.
Step 1: Get Your Measurement ID
- Log in to Google Analytics
- Select your GA4 property
- Go to Admin → Data Streams
- Select your web data stream
- Copy your Measurement ID (format:
G-XXXXXXXXXX)
Step 2: Access Strikingly Custom Code
- Log in to your Strikingly dashboard
- Select your site
- Click Settings in the left sidebar
- Scroll to Advanced section
- Find Custom Code settings
Step 3: Add GA4 Code to Header
In the Header Code field, add:
<!-- Google Analytics 4 -->
<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', {
'send_page_view': true,
'page_title': document.title
});
</script>
Replace G-XXXXXXXXXX with your actual Measurement ID.
Step 4: Save and Publish
- Click Save in the Custom Code section
- Return to your site editor
- Click Publish in the top right
- Wait 30-60 seconds for changes to propagate
Step 5: Verify Installation
Real-time Verification:
- Open Google Analytics
- Go to Reports → Realtime
- Visit your Strikingly site in another tab
- You should see yourself as an active user within 30 seconds
Debug Mode: Add debug mode temporarily to see detailed data:
gtag('config', 'G-XXXXXXXXXX', {
'debug_mode': true
});
Then check Admin → DebugView in GA4.
What Gets Tracked (Basic Implementation)
Automatic Events:
page_view- When someone visits your sitefirst_visit- First time visitorsession_start- New session beginsuser_engagement- User is actively engaged
Automatic Parameters:
- Page URL
- Page title
- Referrer
- User language
- Screen resolution
- Device category
NOT Automatically Tracked:
- Section scrolling on one-page sites
- Button clicks
- Form submissions
- Outbound link clicks
- File downloads
- Video plays
See GA4 Event Tracking for custom event implementation.
Method 2: Google Tag Manager (Recommended)
GTM provides more flexibility and easier management of tracking codes.
Why Use GTM for Strikingly?
- Easier updates: Change tracking without republishing site
- Multiple tags: Manage GA4, Meta Pixel, and more in one place
- Custom events: Easier to implement advanced tracking
- Testing: Preview mode to verify before publishing
- Non-technical updates: Marketers can update tags without code access
Setup Steps
Install GTM on Strikingly
See Install Google Tag Manager for complete GTM installation.
Create GA4 Configuration Tag
Once GTM is installed on your Strikingly site:
a. In GTM, go to Tags → New
b. Click Tag Configuration
c. Select Google Analytics: GA4 Configuration
d. Enter your Measurement ID (G-XXXXXXXXXX)
e. Configure settings (optional):
- Add custom parameters
- Enable debug mode for testing
f. Triggering: Select All Pages
g. Save and name it "GA4 - Configuration"
Publish GTM Container
- Click Submit in GTM
- Add version name: "Initial GA4 setup"
- Click Publish
Verify in GTM Preview Mode
- Click Preview in GTM
- Enter your Strikingly site URL
- Verify GA4 Configuration tag fires
- Check for errors in console
Verify in GA4
- Open GA4 Realtime reports
- Visit your site
- Confirm traffic appears
Strikingly One-Page Site Configuration
Since many Strikingly sites are single-page, configure GA4 for better tracking:
Enhanced Measurement Settings
In GA4, enable Enhanced Measurement for automatic event tracking:
- Go to Admin → Data Streams
- Click your web data stream
- Toggle on Enhanced measurement
- Enable these events:
- Page views (on by default)
- Scrolls (tracks 90% scroll depth)
- Outbound clicks (external links)
- Site search (if applicable)
- Video engagement (if using YouTube)
- File downloads
Virtual Page Views for Sections
For one-page Strikingly sites, track section views as virtual page views:
// Add to Header Code (after GA4 initialization)
document.addEventListener('DOMContentLoaded', function() {
// Track section visibility
const sections = document.querySelectorAll('section[data-title]');
const observer = new IntersectionObserver(function(entries) {
entries.forEach(function(entry) {
if (entry.isIntersecting) {
const sectionTitle = entry.target.getAttribute('data-title');
// Send virtual page view
gtag('event', 'page_view', {
page_title: sectionTitle,
page_location: window.location.href + '#' + entry.target.id
});
}
});
}, { threshold: 0.5 }); // Fires when 50% of section is visible
sections.forEach(function(section) {
observer.observe(section);
});
});
Note: This requires adding data-title attributes to your sections or using section IDs.
User Properties and Custom Dimensions
Enhance GA4 data with Strikingly-specific information:
Template Type
Track which Strikingly template the site uses:
gtag('config', 'G-XXXXXXXXXX', {
'custom_map': {
'dimension1': 'template_name'
}
});
// Set the template (requires identifying template manually)
gtag('event', 'page_view', {
'template_name': 'startup' // Or whatever template you're using
});
Site Type
Identify site purpose:
gtag('set', 'user_properties', {
'site_type': 'portfolio', // or 'business', 'store', 'blog'
'strikingly_plan': 'pro' // track your plan level
});
Strikingly Simple Store Tracking
If using Strikingly's e-commerce features:
Basic E-commerce Setup
// Add after GA4 configuration
gtag('config', 'G-XXXXXXXXXX', {
'currency': 'USD', // Or your currency
'send_page_view': true
});
Product Views
Track when users view products:
// Add click handlers to product elements
document.querySelectorAll('.product-item').forEach(function(item) {
item.addEventListener('click', function() {
gtag('event', 'view_item', {
currency: 'USD',
value: parseFloat(item.dataset.price),
items: [{
item_id: item.dataset.id,
item_name: item.dataset.name,
price: parseFloat(item.dataset.price)
}]
});
});
});
Note: This requires custom code to access product data. See GA4 Event Tracking for detailed e-commerce implementation.
Privacy and Consent
Strikingly doesn't have built-in consent management, so implement your own:
Google Consent Mode
// Add BEFORE GA4 initialization
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
// Set default consent state
gtag('consent', 'default', {
'analytics_storage': 'denied',
'ad_storage': 'denied'
});
// Initialize GA4
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
// Update consent when user accepts
function grantConsent() {
gtag('consent', 'update', {
'analytics_storage': 'granted',
'ad_storage': 'granted'
});
}
Simple Consent Check
// Check for consent before tracking
if (localStorage.getItem('analyticsConsent') === 'true') {
// Initialize GA4
gtag('config', 'G-XXXXXXXXXX');
} else {
// Show consent banner and wait
showConsentBanner();
}
Troubleshooting
GA4 Not Showing Data
Check 1: Code Location
- Ensure code is in Header Code, not Footer
- Verify you clicked Save in Custom Code settings
- Confirm you Published the site after adding code
Check 2: Measurement ID
- Verify Measurement ID is correct (starts with
G-) - Copy directly from GA4 to avoid typos
- Check no extra spaces or characters
Check 3: Browser Console
- Open browser DevTools (F12)
- Check Console tab for JavaScript errors
- Look for
gtag is not definedor similar errors
Check 4: Network Requests
- In DevTools, open Network tab
- Filter by "collect" or "google-analytics"
- Verify requests to
www.google-analytics.com/g/collect
Check 5: Ad Blockers
- Disable ad blockers for testing
- Try incognito/private browsing
- Test from different browser
Duplicate Events
Cause: GA4 code added in multiple locations.
Check for:
- Code in both Header AND Footer
- Code in Header AND custom HTML section
- Native Strikingly analytics (doesn't exist, but check apps)
- Multiple GTM containers
Fix: Remove all but one GA4 implementation.
Events Not Firing
See Events Not Firing for detailed debugging.
Quick checks:
- Verify GA4 tag loads (check Network tab)
- Check for JavaScript errors
- Ensure Enhanced Measurement is enabled
- Test in GA4 DebugView
One-Page Site Only Shows Homepage
This is expected behavior for Strikingly one-page sites.
Solutions:
- Implement virtual page views for sections (code above)
- Focus on event tracking instead of page views
- Use scroll depth tracking
- Track section engagement
Performance Considerations
GA4 can impact Strikingly site performance:
Optimize Loading
<!-- Use async attribute -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<!-- Minimize inline code -->
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
Monitor Impact
Check site speed after adding GA4:
- Use PageSpeed Insights
- Monitor LCP
- Test mobile performance
- Review Strikingly's site speed metrics
Best Practices
- Keep Header Code minimal
- Use async for external scripts
- Don't add multiple analytics platforms directly (use GTM)
- Remove unused tracking code
- Test on mobile devices
Testing Checklist
Before considering GA4 setup complete:
- GA4 code added to Header Code
- Settings saved and site published
- Real-time data appears in GA4 within 60 seconds
- No JavaScript errors in browser console
- Network requests to google-analytics.com visible
- Enhanced Measurement enabled in GA4
- Tested on mobile device
- GTM Preview shows tag firing (if using GTM)
- DebugView shows events (if debug mode enabled)
- Privacy/consent implemented (if required)
Next Steps
- Configure GA4 Event Tracking - Track buttons, forms, and custom interactions
- Install GTM - For easier tag management
- Troubleshoot Tracking Issues - Debug common problems
For general GA4 concepts, see Google Analytics 4 Overview.