Whitelist Webflow's Editor and Designer from Google Analytics to ensure accurate data by removing respective mode activities. Follow our steps for seamless GA tracking.
Improvement
•
October 15, 2024
•
minutes
How to Add the Webflow Whitelisting Tool for GA Tracking Prevention
Step#1
Add the Script to Site Settings in Webflow
Integrating our White Listing tool into your website is simple! Follow these steps to get started:
In the Webflow dashboard, go to Project Settings.
Click on the Custom Code tab.
Scroll down to the Head Code section under Site-wide Custom Code.
Paste the script in this section.
Step#2
Customize the Script
After adding the script to your Webflow site, you will need to customize the Google Analytics Measurement ID to match your own GA property.
Replace the placeholder 'MEASUREMENT-ID' with your own Google Analytics Measurement ID in the following code snippet.
Step#3
Testing your site
Inspect your page while in designer/editor:
Test the functionality by entering Webflow's Editor or Designer mode.
Verify that Google Analytics is disabled when in these modes by checking your browser’s developer console (you should see the log: "Google Analytics disabled for Webflow Editor/Designer mode.").
Once confirmed, the changes will take effect across your entire site
Real-Time Google Analytics Testing:
Open your site in Webflow Editor or Designer mode.
Navigate to the Real-Time section in Google Analytics.
If the script is working, you should not see your session being recorded. If you see activity under Real-Time, the script might not be functioning correctly.
By following these steps, you'll successfully implement the Whitelisting tool on your Webflow site.
<!-- Disable GA tracking in designer/editor mode -->
<script> var measurementID = 'MEASUREMENT-ID'; // Function to check if the user is in Webflow Editor or Designer mode function isWebflowEditorOrDesigner() { return window.location.search.includes('?edit') || window.WebflowEditor; } // If in Editor or Designer mode, disable Google Analytics if (isWebflowEditorOrDesigner()) { window['ga-disable-' + measurementID] = true; console.log('Google Analytics disabled for Webflow Editor/Designer mode.'); }
</script>
By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.