Class ShrimpTest_Metric_Conversion

Description

ShrimpTest Conversion metric type class

An object-oriented metric type specification. This class name is handed to register_shrimptest_metric_type() at the end of this file so it is registered.

Many of the properties in the resulting object are there as register_shrimptest_metric_type() expects them.

Located in /plugins/metric-conversion.php (line 23)


	
			
Variable Summary
string $label
string $name
string $prefix
bool $_default
Method Summary
ShrimpTest_Metric_Conversion ShrimpTest_Metric_Conversion (ShrimpTest $shrimptest_instance)
void admin_add_metric_extra (object $experiment)
array admin_save_filter (array $metric_data)
void check_conversion (array $parsed_query)
string display_value (mixed $value, float $original_value, float $raw)
array print_query_headers (array $headers, array $this_query)
array retrieve_query_vars (string $url)
Variables
string $label = __('Conversion') (line 35)

A user-facing metric type string

string $name = 'conversion' (line 29)

The internal metric designation

string $prefix = 'shrimptest_metric_conversion_' (line 55)

A prefix used for constructing a transient id

string $query_vars_header = 'X-ShrimpTest-Query-Vars' (line 47)

variables used for the query_vars-retreiving code to get a more stable representation for detecting conversion hits.

string $query_vars_parameter = 'shrimptest_query_vars' (line 48)

variables used for the query_vars-retreiving code to get a more stable representation for detecting conversion hits.

bool $_default = true (line 40)

This setting means that we will try to offer this metric as the default for new experiments:

Methods
Constructor ShrimpTest_Metric_Conversion (line 64)

Constructor

Set up actions and filters. Gets called in register_shrimptest_metric_type().

ShrimpTest_Metric_Conversion ShrimpTest_Metric_Conversion (ShrimpTest $shrimptest_instance)
admin_add_metric_extra (line 92)

Print the "metric extra" rows in the "Add new experiment" screen

void admin_add_metric_extra (object $experiment)
  • object $experiment
admin_save_filter (line 138)

Prepare the given conversion metric specification for saving.

array admin_save_filter (array $metric_data)
  • array $metric_data
admin_script_and_style (line 111)

Add styling and JavaScript for the "Add new experiment" screen

void admin_script_and_style ()
check_conversion (line 181)

Check whether we have hit upon any conversion metrics' goal URL's.

If we have, then record that conversion using shrimptest_conversion_success.

void check_conversion (array $parsed_query)
  • array $parsed_query
display_value (line 258)

Displays a display-friendly value for the given $value: in this case, a percentage representation.

string display_value (mixed $value, float $original_value, float $raw)
  • mixed $value
  • float $original_value
  • float $raw
get_conversion_rules (line 197)

Get the "conversion rules": the collection of query vars that we are looking out for, as they represent conversion metric conversions.

array get_conversion_rules ()
print_query_headers (line 220)

Add special headers representing the WP query_vars if a HEAD request was made with the $query_vars_parameter parameter.

array print_query_headers (array $headers, array $this_query)
  • array $headers
  • array $this_query
retrieve_query_vars (line 236)

Use this function to get serialized query vars for any WordPress

Example:

  1. retrieve_query_vars'http://shrimptest.local/2010/06/' )

array retrieve_query_vars (string $url)
  • string $url

Documentation generated on Sat, 04 Sep 2010 23:40:57 -0400 by phpDocumentor 1.4.3