Title: Code will not Validate
Last modified: August 21, 2016

---

# Code will not Validate

 *  Resolved [gregmurch](https://wordpress.org/support/users/gregmurch/)
 * (@gregmurch)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/code-will-not-validate/)
 * After setting everything up as per this guide:
    [ ](http://www.becomeablogger.com/14447/how-to-run-split-tests-in-google-analytics-with-content-experiments/)
   [http://www.becomeablogger.com/14447/how-to-run-split-tests-in-google-analytics-with-content-experiments/](http://www.becomeablogger.com/14447/how-to-run-split-tests-in-google-analytics-with-content-experiments/)
 * I have added the code.
    Experiment Code Validation Original: No experiment code
   found. Variation 1: Google Analytics code found
 * I am using Optimisepress theme,
    Wordfence Plugin, Yoast SEO plugin, Yoast Google
   Analytics Plugin.
 * When I manually edit the header.php file to add in the code i get the errors:
   
   Experiment Code ValidationRevalidate Original: Experiment code found after the
   Google Analytics tracking code:line:34, column:57,line:313, column:1. Variation
   1: Experiment code found after the Google Analytics tracking code:line:33, column:
   57,line:345, column:1. Note: If you’re sure that the pages are properly set up,
   you can still start the experiment.
 * [http://wordpress.org/extend/plugins/google-content-experiments/](http://wordpress.org/extend/plugins/google-content-experiments/)

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

 *  Plugin Author [Glenn Mulleners](https://wordpress.org/support/users/glennm/)
 * (@glennm)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/code-will-not-validate/#post-3750238)
 * Could you please tell me what you exactly edited?
 * You need to insert `<?php do_action( 'wpe_gce_head' ); ?>` right after the opening`
   <head>` tag. I believe OptimizePress has more than one header file, so you might
   need to edit multiple files.
 *  Thread Starter [gregmurch](https://wordpress.org/support/users/gregmurch/)
 * (@gregmurch)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/code-will-not-validate/#post-3750242)
 * I edited the OptimizePress: Main Index Template (admin/index.php)
    it now reads
   <head> <!– Google Analytics Content Experiment code –> <script>function utmx_section(){}
   function utmx(){}(function(){var k=’72203813-0′,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 –>
 * </head>
 *  Plugin Author [Glenn Mulleners](https://wordpress.org/support/users/glennm/)
 * (@glennm)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/code-will-not-validate/#post-3750247)
 * That is the wrong file.
    You need to edit header files in the root of OptimizePress
   directory. I don’t know which files you have exactly, but you might need to edit
   for example:
 * wp-content/themes/OptimizePress/header.php
    wp-content/themes/OptimizePress/header-
   myheader.php wp-content/themes/OptimizePress/header-blogheader.php
 *  Thread Starter [gregmurch](https://wordpress.org/support/users/gregmurch/)
 * (@gregmurch)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/code-will-not-validate/#post-3750265)
 * I have tried to add the code to Header.php on the 2nd line down and it appears
   to be working.
 * Thank you for your help.
    Optimisepress need to update the videos
 *  Plugin Author [Glenn Mulleners](https://wordpress.org/support/users/glennm/)
 * (@glennm)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/code-will-not-validate/#post-3750271)
 * Glad I could help.
 * If you found this plugin useful, there are several things you can do:
 * – Rate the plugin
    – Vote that the plugin works (with the WordPress version you’re
   currently using). – Write a review for the plugin – A combination of the steps
   above
 * I would be most grateful for your contribution!

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

The topic ‘Code will not Validate’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/google-content-experiments_9db5c0.
   svg)
 * [Google Content Experiments](https://wordpress.org/plugins/google-content-experiments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-content-experiments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-content-experiments/)
 * [Active Topics](https://wordpress.org/support/plugin/google-content-experiments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-content-experiments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-content-experiments/reviews/)

## Tags

 * [split test](https://wordpress.org/support/topic-tag/split-test/)

 * 5 replies
 * 2 participants
 * Last reply from: [Glenn Mulleners](https://wordpress.org/support/users/glennm/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/code-will-not-validate/#post-3750271)
 * Status: resolved