Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/joshuaestes/sfgooglewebsiteoptimizerplugin

plugin for symfony 1.4 that allows you to easily integrate google website optimizer
https://github.com/joshuaestes/sfgooglewebsiteoptimizerplugin

Last synced: 1 day ago
JSON representation

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

Awesome Lists containing this project

README

        

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]



Welcome to our site!

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.