Jump to content

defeated

Members
  • Posts

    246
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://www.serpstone.com

Profile Information

  • Gender
    Not Telling

defeated's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Hi Muddy, That's what I was thinking, but there are two sets of script tags within the google code and I don't want to send the solution to the client without being sure it's going to work. In theory it would, but I'm just not hot enough on JS to know for sure.
  2. Hi, Javascript isn't my thing at all. However in this instance I have to use javascript instead of php. I'm trying to add some Google experiment code to just some pages of a site. Here's what I have so far... <script type=“text/javascript”> var theUrl = window.location.href; var lWr=theUrl.toLowerCase(); if(lWr.indexOf(‘the/page/path’) >=0){ <!-- Google Analytics Content Experiment code --> <script>function utmx_section(){}function utmx(){}(function(){var k='63538864-5',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 --> } </script> Obviously that doesn't work, but I can't figure out how to make it work. Help please.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.