Title: Plugin deletes Google Content Experiments code
Last modified: August 30, 2016

---

# Plugin deletes Google Content Experiments code

 *  Resolved [Ofir Beigel](https://wordpress.org/support/users/ofirbeigel/)
 * (@ofirbeigel)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/plugin-deletes-google-content-experiments-code/)
 * Hey, thanks for the plugin.
    However when I put my Google Content Experiments
   code after the header the plugin deletes the script.
 * If I don’t allow JS options it works OK. Any idea how I can work around this ?
 * [https://wordpress.org/plugins/autoptimize/](https://wordpress.org/plugins/autoptimize/)

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

 *  [Scott Hartley](https://wordpress.org/support/users/destac/)
 * (@destac)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/plugin-deletes-google-content-experiments-code/#post-6229629)
 * It isn’t deleting it, its taking it and adding it to the main JS file. What you
   should do is exclude it in Auto Optimize.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/plugin-deletes-google-content-experiments-code/#post-6229635)
 * Hi Ofir;
    Don’t know “Google Content Experiments”, but configure AO to exclude
   it from being optimized ([cfr. FAQ](https://wordpress.org/plugins/autoptimize/faq/))
   and all should be fine.
 * have a nice sunday,
    frank
 *  Thread Starter [Ofir Beigel](https://wordpress.org/support/users/ofirbeigel/)
 * (@ofirbeigel)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/plugin-deletes-google-content-experiments-code/#post-6229650)
 * Thanks for the quick response. I actually excluded it but still it doesn’t seem
   to be working.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/plugin-deletes-google-content-experiments-code/#post-6229651)
 * OK, can you post an example of what the “google content experiment” code looks
   like and describe what you did to exclude that?
 *  Thread Starter [Ofir Beigel](https://wordpress.org/support/users/ofirbeigel/)
 * (@ofirbeigel)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/plugin-deletes-google-content-experiments-code/#post-6229652)
 * This is the code:
 *     ```
       <!-- Google Analytics Content Experiment code -->
       <script>function utmx_section(){}function utmx(){}(function(){var
       k='80514550-3',d=document,l=d.location,c=d.cookie;
       if(l.search.indexOf('utm_expid='+k)>0)return;
       function f(n){if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.
       indexOf(';',i);return escape(c.substring(i+n.length+1,j<0?c.
       length:j))}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;d.write(
       '<sc'+'ript src="'+'http'+(l.protocol=='https:'?'s://ssl':
       '://www')+'.google-analytics.com/ga_exp.js?'+'utmxkey='+k+
       '&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='+new Date().
       valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+
       '" type="text/javascript" charset="utf-8"><\/sc'+'ript>')})();
       </script><script>utmx('url','A/B');</script>
       <!-- End of Google Analytics Content Experiment code -->
       ```
   
 * Here’s what I added as an exclusion:
    plugins/google-content-experiments
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/plugin-deletes-google-content-experiments-code/#post-6229656)
 * there is no “plugins/google-content-experiments” to exclude as there is no JS
   located there and as that string does not appear in the inline JS, but “utmx_section”
   for example should work, can you give that a try?
 * frank
 *  Thread Starter [Ofir Beigel](https://wordpress.org/support/users/ofirbeigel/)
 * (@ofirbeigel)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/plugin-deletes-google-content-experiments-code/#post-6229659)
 * This seems to work thanks!

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

The topic ‘Plugin deletes Google Content Experiments code’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [Ofir Beigel](https://wordpress.org/support/users/ofirbeigel/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/plugin-deletes-google-content-experiments-code/#post-6229659)
 * Status: resolved