Title: Linking Optimize to WordPress using GA plugin
Last modified: February 9, 2021

---

# Linking Optimize to WordPress using GA plugin

 *  Resolved [chanvaz](https://wordpress.org/support/users/chanvaz/)
 * (@chanvaz)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/linking-optimize-to-wordpress-using-ga-plugin/)
 * I’m unable to link Google Optimize to WordPress Account using GA plugin. I followed
   the below steps for GA Universal Analytics (analytics.js)
 * Tracking code location: include in wp_head
 * Custom tracker options: ga(‘require’, ‘OPT-XXXXXXX’);
 * Custom Code:
    <HTML> <HEAD> <!– anti-flicker snippet (recommended) –> <style>.
   async-hide { opacity: 0 !important} </style> <script>(function(a,s,y,n,c,h,i,
   d,e){s.className+=’ ‘+y;h.start=1*new Date; h.end=i=function(){s.className=s.
   className.replace(RegExp(‘ ?’+y),”)}; (a[n]=a[n]||[]).hide=h;setTimeout(function(){
   i();h.end=null},c);h.timeout=c; })(window,document.documentElement,’async-hide’,’
   dataLayer’,4000, {‘OPT-XXXXXXX’:true});</script>
 * I still see the below error:
 * We found problems with the Optimize installation on this page
    Refer to the diagnostics
   below to fix problems and troubleshoot any issues with your installation. Learn
   more about diagnostics . Errors Analytics pageview not detected This page isn’t
   sending pageview hits to Google Analytics property (UA-XXXXXX-XX) configured 
   for this experiment. You won’t be able to measure usage of your site or monitor
   performance of Optimize experiments. Make sure that your Analytics tracking code(
   either analytics.js or gtag.js ) is set up correctly.
 * Suggestions
    Optimize not in the HEAD For best performance, the snippet that 
   loads the Optimize plugin (whether it’s Analytics, Tag Manager, or gtag.js) should
   be installed in the <HEAD> element of your web page, immediately after the anti-
   flicker snippet . The Deploy Optimize help center article and tagging best practices
   section contain more information on the best way to install Optimize.
    -  This topic was modified 5 years, 4 months ago by [chanvaz](https://wordpress.org/support/users/chanvaz/).

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/linking-optimize-to-wordpress-using-ga-plugin/#post-14027626)
 * I’m not sure, but it looks like the custom code you are entering may be causing
   issues. Have you examined the actual source code on your pages, to make sure 
   that it is what you want.
 *  Thread Starter [chanvaz](https://wordpress.org/support/users/chanvaz/)
 * (@chanvaz)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/linking-optimize-to-wordpress-using-ga-plugin/#post-14027635)
 * Hey Jeff, the custom code is just an anti-flicker code. I tried removing that
   too. Didn’t work.
 * Although, I’m tried to install this on staging site of WordPress, does the code
   not work if it’s installed on staging site?
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/linking-optimize-to-wordpress-using-ga-plugin/#post-14027744)
 * Yeah actually the plugin is very simple, works on any WP site. You might want
   to try completely removing the plugin (via the Plugins screen) and then starting
   over. After installing fresh copy, leave all settings at defaults. Then only 
   add your tracking ID and save changes. This will give you correct tracking code,
   which you can verify by examining the source code of your pages.
 * Once you have the correct base tracking code all good, then you can try adding
   custom tracker or whatever is needed. But when you do it, go one thing at a time.
   That way you can verify changes at each step, so if/when something goes wrong,
   you will know exactly which step was at fault.
 *  Thread Starter [chanvaz](https://wordpress.org/support/users/chanvaz/)
 * (@chanvaz)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/linking-optimize-to-wordpress-using-ga-plugin/#post-14028378)
 * Hi Jeff, I tried, it still didn’t work.
 * I have a question, I think this might answer why isn’t it working. I have connected
   Google Analytics via Monster Insights and I’m trying to connect Optimize using
   GA Google Analytics plugin. Google Analytics is also linked via this plugin. 
   Could it be that it’s not working because of two plugins?
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/linking-optimize-to-wordpress-using-ga-plugin/#post-14032386)
 * Yeah only use one plugin for Google Analytics. Trying to use more than one will
   only cause problems in most cases.
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/linking-optimize-to-wordpress-using-ga-plugin/#post-14129973)
 * Hi [@chanvaz](https://wordpress.org/support/users/chanvaz/), just wanted to follow
   up with this. It’s been awhile with no reply, so I hope the issue is resolved?
   Or if there is anything I can do to help, please let me know. Thank you.
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/linking-optimize-to-wordpress-using-ga-plugin/#post-14175004)
 * Hey [@chanvaz](https://wordpress.org/support/users/chanvaz/), I hope you got 
   this sorted. It’s been awhile with no reply so gonna go ahead and mark this thread
   as resolved to help keep the forum organized. Feel free to post again with any
   further questions or feedback, Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Linking Optimize to WordPress using GA plugin’ is closed to new replies.

 * ![](https://ps.w.org/ga-google-analytics/assets/icon-256x256.png?rev=2053004)
 * [GA Google Analytics – Connect Google Analytics to WordPress](https://wordpress.org/plugins/ga-google-analytics/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ga-google-analytics/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ga-google-analytics/)
 * [Active Topics](https://wordpress.org/support/plugin/ga-google-analytics/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ga-google-analytics/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ga-google-analytics/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/linking-optimize-to-wordpress-using-ga-plugin/#post-14175004)
 * Status: resolved