Skip to content

JoshuaEstes/sfGoogleWebsiteOptimizerPlugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Note: This plugin is currently a fork of the current sfGoogleOptimizerPlugin



Installation
------------

This plugin requires you add its filter to your project's `filters.yml` configuration file:

    rendering: ~
    web_debug: ~
    security:  ~

    # generally, you will want to insert your own filters here
    sf_google_website_optimizer_plugin:
      class: sfGWOFilter

    cache:     ~
    common:    ~
    flash:     ~
    execution: ~

A/B Experiments
---------------

The configuration for an A/B experiment should look something like this (in `app.yml`):

    all:
      sf_google_website_optimizer_plugin:
        enabled:      on
        uacct:        XX-XXXXX-X
        experiments:
          register1:
            type:     ab
            key:      XXXXXXXXXX
            pages:
              original: { module: auth, action: register, alt: ~ }
              variations:
                - { module: auth, action: register, alt: 1 }
                - { module: auth, action: register, alt: 2 }
              conversion: { module: main, action: welcome }

Once configured, the plugin's filter will automatically insert the necessary code to run this experiment on those requests whose parameters match those of the original, variation and conversion pages.

The example above uses one action with multiple template files. This `auth/register` action may look something like this:

    [php]
    class authActions extends sfActions
    {
      public function executeRegister()
      {
        switch ($this->getRequestParameter('alt'))
        {
          case '1':
          return 'Alt1';
      
          case '2':
          return 'Alt2';
      
          default:
          return sfView::SUCCESS;
        }
      }
    }

The experiment would then serve up one of the following template files:

 * `registerAlt1.php` (variation 1)
 * `registerAlt2.php` (variation 2)
 * `registerSuccess.php` (original)

Multivariate Experiments
------------------------

The configuration for a multivariate experiment should look something like this (in `app.yml`):

    all:
      sf_google_website_optimizer_plugin:
        enabled:      on
        uacct:        XX-XXXXX-X
        experiments:
          home1:
            type:     multivariate
            key:      XXXXXXXXXX
            pages:
              test: { module: main, action: index }
              conversion: { module: auth, action: register }

The view for `main/index` should include calls to the plugin's helper functions to declare the experiment sections:

    [php]
    <?php use_helper('GWO') ?>

    <h1>
    <?php echo gwo_section('greeting') ?>
    Welcome to our site!
    <?php echo gwo_section_end() ?>
    </h1>

How to determine your experiment `key` and `uacct` values
---------------------------------------------------------

These values can be easily extracted from the code Google provides for insertion at the bottom of your experiment's conversion page. Toward the bottom of this code, you'll see something like this:

    _uacct = 'XX-XXXXX-X';
    urchinTracker("/XXXXXXXXXX/goal");

Your experiment's `uacct` value is the string of letters and numbers assigned to the Javascript `_uacct` variable. Your experiment's key is the string of numbers between the two slashes in the string passed to the Javascript `urchinTracker` function.

About

plugin for symfony 1.4 that allows you to easily integrate google website optimizer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages