Title: [Plugin: Google Content Experiments] Fatal error: Call to undefined function wp_get_theme()
Last modified: August 20, 2016

---

# [Plugin: Google Content Experiments] Fatal error: Call to undefined function wp_get_theme()

 *  [JM PHR](https://wordpress.org/support/users/prok444/)
 * (@prok444)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-google-content-experiments-fatal-error-call-to-undefined-function-wp_get_theme/)
 * When I paste the google experiments code, I receive this error message on the
   page:
 * > Fatal error: Call to undefined function wp_get_theme() in /home/prok444/public_html/
   > wp-content/plugins/google-content-experiments/class-wpe-GCE.php on line 69
 * Sso the page is completely blank except for that error message.
 * I also tried adding this code to the beginning:
 * > <script>
   >  _udn = “mycreditdoc.com”; </script>
 * Here is the specific URL:
    [https://mycreditdoc.com/what-is-the-credit-repair-doctor/](https://mycreditdoc.com/what-is-the-credit-repair-doctor/)
 * Thank you for your help!
 * [http://wordpress.org/extend/plugins/google-content-experiments/](http://wordpress.org/extend/plugins/google-content-experiments/)

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

 *  Plugin Author [Glenn Mulleners](https://wordpress.org/support/users/glennm/)
 * (@glennm)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-google-content-experiments-fatal-error-call-to-undefined-function-wp_get_theme/#post-3050979)
 * You need to upgrade your WordPress version.
 * Please read the [FAQ](http://wordpress.org/extend/plugins/google-content-experiments/faq/),
   where this question is answered.
 *  Thread Starter [JM PHR](https://wordpress.org/support/users/prok444/)
 * (@prok444)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-google-content-experiments-fatal-error-call-to-undefined-function-wp_get_theme/#post-3051035)
 * I don’t get the error message now, thank you.
    Google Experiments says “No Experiment
   Code Found”
 * I have deactivated the caching plugin, waited 5 minutes after saving page with
   code, and tried with and without the:
    <script> _udn = “mycreditdoc.com”; </script
   >
 * I looked at the source code and there is a part that says:
    <!– Google Analytics
   tracking code not shown because users over level 8 are ignored –>
 * Searching the internet doesn’t give any good reasons for what and why?
    Not sure
   if this matters or not.
 * Here is the URL:
    [https://mycreditdoc.com/what-is-the-credit-repair-doctor/](https://mycreditdoc.com/what-is-the-credit-repair-doctor/)
 * Thanks for your help, I’m really glad you created this plugin!
 *  Plugin Author [Glenn Mulleners](https://wordpress.org/support/users/glennm/)
 * (@glennm)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-google-content-experiments-fatal-error-call-to-undefined-function-wp_get_theme/#post-3051053)
 * The
 * > <!– Google Analytics tracking code not shown because users over level 8 are
   > ignored –>
 *  is part of the Google Analytics for WordPress by Yoast plugin. There is a setting
   to ignore administrators, therefore the tracking code is not shown.
 * I see that you’re using the Thesis theme, which is not supported by default by
   the GCE plugin. Did you execute the additional steps which can be found on the
   [Installation](http://wordpress.org/extend/plugins/google-content-experiments/installation/)
   page?
 * You need to insert `<?php do_action( 'wpe_gce_head' ); ?>` somewhere in the theme
   files. Without that code, the Experiment Code is not inserted, which explains
   why Google is not able to find it.
 * Since I do not have access to Thesis theme files, I can’t tell you where exactly
   you should insert the code.
 *  Thread Starter [JM PHR](https://wordpress.org/support/users/prok444/)
 * (@prok444)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-google-content-experiments-fatal-error-call-to-undefined-function-wp_get_theme/#post-3051116)
 * I appreciate your help. I’ve been working with the THesis support and the best
   we can do so far is get the code before the </head> tag. (Not right after the
   <head>)
 * Google Experiments gives this message when checking for the code:
 * > The experiment code was found after the Google Analytics tracking code:line:
   > 22, column:124, line:90, column:1.
 * Will this be an issue?
 * Thank you for helping!
 *  Plugin Author [Glenn Mulleners](https://wordpress.org/support/users/glennm/)
 * (@glennm)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-google-content-experiments-fatal-error-call-to-undefined-function-wp_get_theme/#post-3051117)
 * Hi Prok444,
 * By default, WordPress is lacking an action hook to execute code right after `
   <head>`. That´s why you need to insert the action hook in the theme files.
 * Some themes do provide an action hook right after `<head>`, which makes it easy
   for the GCE plugin to hook into those hooks. Supported themes that hook into 
   an existing action hook are listed on the [Installation page](http://wordpress.org/extend/plugins/google-content-experiments/installation/).
 * According to [official Google documentation](http://support.google.com/analytics/bin/answer.py?hl=en&answer=2364634):
 * > **Issue:** Your page has the Google Analytics tracking code before the experiment
   > code. This can cause a problem with your experiment.
   > **Solution:** Move the experiment code so it comes before the Google Analytics
   > tracking code. In general, the experiment code should be right after the opening
   > head tag.
 * So: You might try to see if your experiment will work (although the experiment
   code is after the Analytics code), but I can’t guarantee that it will work.
 * Unfortunately there’s nothing I can do, since this is a theme-related issue.
 *  Thread Starter [JM PHR](https://wordpress.org/support/users/prok444/)
 * (@prok444)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-google-content-experiments-fatal-error-call-to-undefined-function-wp_get_theme/#post-3051118)
 * Thank you for the quick response!
    I’m working with the Thesis team on their 
   forum.
 * Thank you for the great support!
 *  Thread Starter [JM PHR](https://wordpress.org/support/users/prok444/)
 * (@prok444)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-google-content-experiments-fatal-error-call-to-undefined-function-wp_get_theme/#post-3051123)
 * Hi Glenn,
 * I think we finally figured out how to insert that code into the head.
    Now, I’m
   running into this error message:
 * > Tracking code missing the cookie domain name declared in experiment code:line:
   > 75, column:1, line:92, column:1.
   >  Your page customizes the cookie domain name
   > in the Google Analytics tracking code. The same customization should be present
   > in the experiment code
 * **I added this to the beginning of the experiments code like mentioned in your
   FAQ:
    
   <script>
    _udn = “mycreditdoc.com”; </script>
 * This is the page I’m trying to get it to work:
    [https://mycreditdoc.com/what-is-the-credit-repair-doctor](https://mycreditdoc.com/what-is-the-credit-repair-doctor)
 * I have the google analytics plugin installed, but didn’t see anything that “jumped”
   out at me to cause this issue.
 * Do you know what else could be causing it?
    Here is the experiments code I have
   pasted in your plugin section on that page:
 *     ```
       <script>
       _udn = "mycreditdoc.com";
       </script>
       <!-- Google Analytics Content Experiment code -->
       <script>function utmx_section(){}function utmx(){}(function(){var
       k='52360893-1',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 -->
       ```
   
 * Thanks for your help!
    Jeremy
 *  Plugin Author [Glenn Mulleners](https://wordpress.org/support/users/glennm/)
 * (@glennm)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-google-content-experiments-fatal-error-call-to-undefined-function-wp_get_theme/#post-3051124)
 * Dear Jeremy,
 * You don’t need to insert the extra code, only the Google Content Experiment code.
   You’re now declaring an extra cookie domain, which is not present in the Google
   Analytics tracking code.
 * Delete
 *     ```
       <script>
       _udn = "mycreditdoc.com";
       </script>
       ```
   
 * from the Google Content Experiments code field and only insert the code between
   `
   <!-- Google Analytics Content Experiment code -->` and `<!-- End of Google Analytics
   Content Experiment code -->`
 * By the way: at this moment your code is still showing up before the `</head>`
   tag instead of right after the `<head>` tag, which might be causing issues with
   Google.
    Please let me know if you’ve found a solution for this with the Thesis
   support team.

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

The topic ‘[Plugin: Google Content Experiments] Fatal error: Call to undefined function
wp_get_theme()’ 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

 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)
 * [undefined function](https://wordpress.org/support/topic-tag/undefined-function/)
 * [wp_get_theme](https://wordpress.org/support/topic-tag/wp_get_theme/)

 * 8 replies
 * 2 participants
 * Last reply from: [Glenn Mulleners](https://wordpress.org/support/users/glennm/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-google-content-experiments-fatal-error-call-to-undefined-function-wp_get_theme/#post-3051124)
 * Status: not resolved