Question

I'm currently using Google Experiments (previously: Google Website Optimizer) to do A/B testing for my site which runs on Joomla 1.5.

The problem is that that setup only works for testing specific articles/pages created in Joomla. I.e.: I create a variation page, get the URL and test it against the original URL in Google Experiments (that switches the layout of the original page to the variation automatically via a script in the HEAD of the original page).

What I want to do is A/B the frontpage. I've created a "new" frontpage, which has a different URL. But how can I add the Experiments script to just show up on the frontpage, and not all the pages of the site, when working with the index-page? If i add the script to the index.php file it will show up on all pages of my site.

Was it helpful?

Solution 2

I managed to solve this without using a plugin. Not saying the plugin PersianBoy67 posted wont work, but this is what worked for me. Inside the index.php file I added the following php code:

<?php if( JRequest::getCmd('view') == 'frontpage') { ?>
Google Analytics Experiments code goes here
<?php } ?>

That JRequest will echo "frontpage" if it's on the frontpage (and "article" if it's on an article), meaning that the Experiments code will only show when it's on the frontpage.

OTHER TIPS

I've faced this issue in several cases using Joomla! and it is a bit annoying sometimes. What you need is to add an extension to give you an option to add code in header section of a particular page.

Try using these extensions:

http://extensions.joomla.org/extensions/edition/custom-code-in-modules/11936

http://extensions.joomla.org/extensions/5139/details

I think the first one would work fine for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top