Google web optimizer and Joomla

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Locked
User avatar
compass
Joomla! Ace
Joomla! Ace
Posts: 1347
Joined: Fri Aug 26, 2005 1:31 am
Contact:

Google web optimizer and Joomla

Post by compass » Fri Jul 11, 2008 2:01 pm

Hi,
I have been working with the product manager of Google web optimizer regarding integrating GWO into Joomla 1.5

There is one last issue I can't seem to figure out!

The problem is with placing this bit of code:

Code: Select all

<script>
function utmx_section(){}function utmx(){}
(function(){var k='0404766662',d=document,l=d.location,c=d.cookie;function f(n){
if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.indexOf(';',i);return 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'
+'/siteopt.js?v=1&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>
When Joomla processes it (in this case on a subdomain), it is presented as:

Code: Select all

<script>
function utmx_section(){}function utmx(){}
(function(){var k='0404766662',d=document,l=d.location,c=d.cookie;function f(n){
if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.indexOf(';',i);return 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'
+'/siteopt.js?v=1&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>
Notice the added / halfway down

Expected to find: te('<sc'+'ript src="'+'
Found on line 85: te('<sc'+'ript src="/'+

At first I thought Joomla was adding an escape, but when I ran it on an installation that was in the folder, it showed a path as well as the /

I obviously have editor turned off, and even tried using a couple of Jumi-like extensions that embed code. Still the same.

Anyone got any ideas?
Follow me on Twitter @compassdesign
www.compassdesigns.net - Get get free templates and news for Joomla
simplweb.com/joomla-hosting - Fully Managed Joomla Hosting - Unlimited Support

User avatar
compass
Joomla! Ace
Joomla! Ace
Posts: 1347
Joined: Fri Aug 26, 2005 1:31 am
Contact:

Re: Google web optimizer and Joomla

Post by compass » Tue Jul 15, 2008 5:07 pm

Thanks go out to Anthony Ferrara for tracking down and fixing the issue here!

http://joomlacode.org/gf/project/joomla ... m_id=11844

There is a patch file associated:
http://joomlacode.org/gf/download/track ... _fix.patch
Follow me on Twitter @compassdesign
www.compassdesigns.net - Get get free templates and news for Joomla
simplweb.com/joomla-hosting - Fully Managed Joomla Hosting - Unlimited Support

farache
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Jul 14, 2008 12:33 am

Re: Google web optimizer and Joomla

Post by farache » Sat Aug 09, 2008 8:43 pm

hi,
I was reading compassdesing to get the answer on how to configure google optimizer.

I have many issues on this,
first
How i set up the home page different than the front page, lets say when access www.mysite.com it get an article in
www.mysite.com/article1.


second, how do i get this patch to work? i'm trying to get it to work but still google optimizer gives me the errors.
i patched the sef.php file ( copied the code in line 57 replacing the old line ).

please let me know how to fix this.. i'm new to joomla .
I already patched joomla to 1.55

thanks

farache
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Jul 14, 2008 12:33 am

Re: Google web optimizer and Joomla

Post by farache » Sat Aug 09, 2008 8:44 pm

also,
does this patch works with SHSEF404

farache
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Jul 14, 2008 12:33 am

Re: Google web optimizer and Joomla

Post by farache » Sun Aug 10, 2008 7:14 am

well,
i got everything to work now.

i just needed to read. :-[

ritarita
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Wed Oct 15, 2008 7:26 am

Re: Google web optimizer and Joomla

Post by ritarita » Fri Nov 14, 2008 10:15 am

i am using joomla1.5.7 that patch is not working for me.i got this error
Expected to find: +'/siteopt.js?v=1&utmxkey='+k+'&utmx=
Found on line 199: +'/siteopt.js?v=1&utmxkey='+k+'&a
i am just copying the patch code and replace it in my sef.php(replacing line 58 to 64).any idea?

riga75
Joomla! Intern
Joomla! Intern
Posts: 94
Joined: Tue Jul 18, 2006 5:58 pm
Location: Italy
Contact:

Re: Google web optimizer and Joomla

Post by riga75 » Wed Dec 24, 2008 5:32 pm

Excuse me but the file I downloaded, where the load? The root?
The beauty of life ............ to live it with enthusiasm.
www.enthous.it


Locked

Return to “Joomla! 1.5 Coding”