A client approached me about an error they were experiencing with Google Optimize. They had installed Google Tag Manager, Google Analytics and Google Optimize tags but when checking the Optimize installation received the error “Analytics code not found”
Google Tag Assistant showed that all tags were installed correctly. A further check in the WordPress back end showed everything was in the right place, eg close to the opening
<head> tag. The Analytics snippet was re-installed to ensure it included the additional Optimize tag. Unfortunately the problem still persisted.
Heading to Google support forums, I discovered that others were also experiencing this problem. Google had acknowledged the bug and was “working on a fix”.
When coming across an error like this I am like a dog with a bone. I was determined to find a fix and assist my client.
To fix the Google Optimize “Analytics tracking code not found issue” I decided to go right back to the beginning and took the following steps.
- Remove all the Google Tag Manager (GTM), Google Analytics (GA) and Google Optimize tags you have added either between the <head>
or <body> tags.
- Install the Google’s Official WordPress Plugin Site Kit and let this plugin install and manage your GTM, GA & Optimize tags.
- From your WordPress Dashboard go to Site Kit > Settings > Analytics > Edit
- Ensure the option for Site Kit to insert the Analytics Snippet is enabled
- Log out of WordPress
- Go back to Google Optimize and test your installation, it should now get the green tick!
Did you find this useful?
Get in touch to see how Leaf Marketing can help your business grow.