How to Fix The Google Optimize “Analytics code not found” Error In WordPress

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. 

The Solution

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.

  1. Remove all the Google Tag Manager (GTM), Google Analytics (GA) and Google Optimize tags you have added either between the <head> or <body> tags.
  2. Install the Google’s Official WordPress Plugin Site Kit and let this plugin install and manage your GTM, GA & Optimize tags.
  3. From your WordPress Dashboard go to Site Kit > Settings > Analytics > Edit
  4. Ensure the option for Site Kit to insert the Analytics Snippet is enabled
  5. Log out of WordPress
  6. 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.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top