This guide provides an overview to common errors and misconfigurations we’ve seen customers might have with their Google Optimize settings with MonsterInsights.
If you’re just looking to set up Google Optimize the easy way, please see our guide: How to Set Up Google Optimize in WordPress (the Easy Way).
Looking for more documentation? We have more docs specifically setting up Google Optimize for WordPress.
The most common misconfigurations with Google Optimize:
- The Google Optimize snippet for the container with ID GTM-******* is not correctly installed on this page.
- Uncaught ReferenceError: ga is not defined.
- A gray or white screen for several seconds before the page loads.
If You’re Seeing Errors Similar to:
The Google Optimize snippet for the container with ID GTM-******* is not correctly installed on this page. To preview variants for this experiment, make sure the Google Optimize snippet is installed on any pages you want to test.
This page does not have an Optimize snippet for this container. To preview this page and start an experiment, please check that your page has the snippet properly set up.
Make sure you’re logged out of WordPress when viewing the variant because MonsterInsights doesn’t track logged-in admins and editors by default. More information on this error here.
Uncaught ReferenceError: ga is not defined:
You’ll need to turn on Compatibility Mode in MonsterInsights.
Enabling compatibility mode allows MonsterInsights to work with other plugins and Google Analytics code which don’t use the Google method to look up the Google Analytics object name, making MonsterInsights even more flexible. Here’s how to enable compatibility mode in MonsterInsights.
A gray or white screen for several seconds before the page loads:
Basically, every time any public page loads it presents with a full grey screen for a few seconds before allowing the page to load.
The likely scenario is your Google Optimize container isn’t published. So MonsterInsights waits for Google Optimize container to be fulfilled. But the container isn’t published at optimize.google.com which will cause it to have a blank screen for the full 4 seconds. Please see our guide on how to fix this issue: Google Optimize Troubleshooting: Flash of White or Gray Screen for Several Seconds Before Page Load
That’s it! Those are the most typical misconfigurations with Google Optimize and how to fix them.