Jump to content

Google Website Optimizer


Martin

Recommended Posts

Hello there

Im trying to use Google Website Optimizer with my prestashop, but find it problamatic since its hard to make 2 drifrent versions of the same shop...

anyone have any idia how to start....

the problem is that the blocks/modules is installed in the database and I dont know how to make 2 index.php that showes drifrent blocks/modules or just in drifrent places

Link to comment
Share on other sites

In GWO you do not make two versions of the whole shop,
you make two versions of the pages you want to optimize.

For example if you want to optimize the entry to the funnel,
you take your current entry page and then use a second
page with different content, position of content, etc.

Link to comment
Share on other sites

i knew that but, what if i want to test the frontpage with drifrent modules

Eks:

one with the advetising block and one with out advitising block

or

one where the advitising is on the left and one with it on the right


since its controled in the database (i prosume) how is this posible to do with out making big changes to the programming or making 2 shops with 2 databases

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

Now i have a changed the setting.inc.php to handle 2 or more themes. I was inspired to do this by one of our moderators.

What i do is comment out define('_THEME_NAME_', 'original_theme'); with to // if someone wounder how ;)

Then at the very top i add this:

//cokie lifetime set to around 116years.
$lifetime = 60 * 60 * 24 * 60 * 1000 + time();
//To activate test off themes change to 1
$activate = 0;
if ($activate) {
  if ($_COOKIE['theme']) {
     //as the generates a cookie with a long life, you can goto yourwebpage.php?removecookie=1 to remove the cookie to see if both theme work with this.
     if ($_GET['removecookie'] == 1) {
        setcookie('theme', '', '-3600');
        echo $_COOKIE['theme'];
     }
     else {
        define('_THEME_NAME_', $_COOKIE['theme']);
     }
  }
  else {
     if ($_GET['theme']) {
        if ($_GET['theme'] == 1) {
           //original theme can both be accessed by the orignal URL but allso yourwebpage.php?theme=1
           setcookie('theme', 'original_theme', $lifetime);
           $_COOKIE['theme'] = 'original_theme';
           define('_THEME_NAME_', $_COOKIE['theme']);
        }

        if ($_GET['theme'] == 2) {
           //original theme can be accessed by the variation URL yourwebpage.php?theme=2
           setcookie('theme', 'variation_theme', $lifetime);
           $_COOKIE['theme'] = 'variation_theme';
           define('_THEME_NAME_', $_COOKIE['theme']);
        }
     }
     else {
        //original URL set the original theme
        setcookie('theme', 'original_theme', $lifetime);
        $_COOKIE['theme'] = 'original_theme';
        define('_THEME_NAME_', $_COOKIE['theme']);
     }
  }
}
//if you want to test a theme you can access it by youwebpage?testtheme=123
else if ($_GET['testtheme'] == '123') {
  define('_THEME_NAME_', 'theme_for_testing_perpapses');
}
//Fore those how cant use a cookie, they will be directed to the original theme every time 
else { define('_THEME_NAME_', 'original_theme'); }



Now what i do is to upload another theme with 'variation_theme' as the name, and my original theme has the name 'original_theme'. Then i make small variation to test. (i copy'ed my old theme and made the small changes)

Now my problem is, where the he.. should i add java code from website optimzer? I have tryed all sorts off places, but every time the browser fails. I was actualy looking forward to giving the full answer, but now i have to ask others to help me with the rest :)

  • Like 1
Link to comment
Share on other sites

Hi. The Prestashop settings file gets overwritten when saving some changes in the back office, so make sure you have a backup :) You refer to java code - do you mean javascript ? From the little bit I've read about google optimizer it assumes there are two versions of a page contained within a single HTML file. It uses javascript to choose the layout to test and collects the results. By creating different themes you will have different pages in different HTML files, this does not seem to be compatible the way the optimizer works.

I have never used GWO so I can't be sure - but I hope this can point you in the right direction.

Link to comment
Share on other sites

I just found out about the overwriting off the settings file :) But thanks anyway :).

Yes javascript, wich i assume is allso written in code ;) I beleave i called it JS.

The JS should be added at the very start off the pages, and just before the </body> tag. This i beleave can be done by adding it to the header, and to the footer.tpl. But there i was mistaken.

I dont know how it works, but there must be away to use it over severalpages, all must any mayor webshop is build useing include(); (if they are php)

Link to comment
Share on other sites

When I referred to a single HTML file I mean from the perspective of the client - not the server. But I guess from the perspective of the client it does not know which theme you are using if the web address is exactly the same (which it will be if you are using cookies to select the theme). It might be possible to include the GWO code in the file used in both themes. Is there a demo page available so we can see what the error in the browser is ?

Link to comment
Share on other sites

There are 2 codes, one for eache page. I do not assume that they are the same, but hasent checked it out. No i havent set up a demo page with this. In my browser there isnt any error's just a blank page. Thanks for helping btw :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...