Piwik\Plugins\CoreHome\Columns\Metrics\

ConversionRate

The percent of visits that result in a conversion.

Calculated as:

nb_visits_converted / nb_visits

nb_visits_converted & nb_visits are calculated by the archiving process.

Methods

The class defines the following methods:

compute()

Computes the metric using the values in a Row.

The computed value should be numerical and not formatted in any way. For example, for a percent value, 0.14 should be returned instead of "14%".

Signature

  • It accepts the following parameter(s):

    • $row (Row) —
  • It returns a mixed value.

getDependentMetrics()

Returns the array of metrics that are necessary for computing this metric.

The elements of the array are metric names.

Signature

  • It returns a string[] value.

getTemporaryMetrics()

Returns the array of metrics that are necessary for computing this metric, but should not be displayed to the user unless explicitly requested.

These metrics are intermediate metrics that are not really valuable to the user. On a request, if showColumns or hideColumns is not used, they will be removed automatically.

Signature

  • It returns a string[] value.

beforeCompute()

Executed before computing all processed metrics for a report.

Implementers can return false to skip computing this metric.

Signature

  • It accepts the following parameter(s):

  • Returns: bool — Return true to compute the metric for the table, false to skip computing this metric.