WordPress.org

Ready to get started?Download WordPress

Forums

Google Content Experiments
[resolved] Error when validating code (3 posts)

  1. reenasud
    Member
    Posted 1 year ago #

    Hi I'm getting an error when I try to validate my code on the google experiment site.

    I inserted the following tag in the <head>
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    <head profile="http://gmpg.org/xfn/11">
    <?php do_action( 'wpe_gce_head' ); ?>

    And added the experiment code to my original page.
    http://www.thinkescape.com/reservation-request/

    Here's the error I get:
    Request Original: http://www.thinkescape.com/reservation-request/
    Possibly broken experiment code found here: line:1, column:230.
    We couldn't find valid experiment code, but we found something that looks like broken experiment code.
    Request Different Format: http://www.thinkescape.com/party-bus-rental-quote-request/
    Request Less Fields: http://www.thinkescape.com/party-bus-quote-request/

    http://wordpress.org/extend/plugins/google-content-experiments/

  2. glennm
    Member
    Plugin Author

    Posted 1 year ago #

    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>
  3. reenasud
    Member
    Posted 1 year ago #

    Thanks for the fix. It worked perfectly :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.