Glenn Mulleners
Forum Replies Created
-
I’ve checked your experiment code and found differences (underscores) with two experiment code snippets I’m using myself.
I’ve adjusted your code. Try using the code below and see if you get your experiment validated:
<script>function utmx_section(){}function utmx(){}(function(){var k='132090-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>
Daan,
Thank you for reporting this issue.
I’ve released version 1.0.1 of my plugin which should solve the issue with the category pages.Hello Daan,
My plugin is just to insert the experiment code on the correct place.
A solution might be to create two “pages” instead of two posts. That way I don’t think they don’t show up under recent posts. To do this, the content of your page should be suitable for a page, otherwise this trick won’t work.
Please let me know if you managed to solve this issue ??
Thanks!
Glenn
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.I’m closing this thread since the issue has been resolved.
jadobulku: Please don’t post such things here since it has nothing to do with the plugin.
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.According to official Google documentation:
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.
I have no experience with Gantry, so I don’t guarantee that it will work, but I see two files that are using the
<head>
tag.Insert
<?php do_action( 'wpe_gce_head' ); ?>
right after<head>
in header.php and index.phpThe
<!– 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 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.
You need to upgrade your WordPress version.
Please read the FAQ, where this question is answered.
Updated Frequently Asked Questions.
The error is not caused by the plugin or your code update, but by Google itself (experiment code).
Based on this topic I think you should be able to fix the code.
Please let me know whether you managed to get your page validated.
Since I got this question a lot recently, I’ll add this to the FAQ.
Hi h50n,
Thank you for your question.
This problem occurs due to an error in the experiment code.
The following code is present in your Google Analytics tracking code:
['_setDomainName','speechplug.com']
Because of this, you should add the following code above the experiment code you got from Google:<script> _udn = "speechplug.com"; </script>
In total, the experiment code you put in the Experiment code field of the GCE plugin should look like:
<script> _udn = "speechplug.com"; </script> <!-- Google Analytics Experiment code --> ... Contents of the experiment code ... <!-- End of Google Analytics Experiment code -->
Please let me know if this resolves your issue.
I’ve updated the Requires: on the plugin page to 3.4.0 or higher and added the Call to undefined function
wp_get_theme
question to the FAQ.I’ve just updated the installation instructions and the screenshot description.
Thanks for your comment Ben!
That’s exactly the way it works. You can add your code in the Google Content Experiment Settings metabox at the post/page edit screen.Did this solve your issue Kenny?