Piwik\Plugins\MultiSites\Columns\Metrics\

EcommerceOnlyEvolutionMetric

Ecommerce evolution metric adapter.

This is a special processed metric for MultiSites API methods. It will only be calculated for sites that have ecommerce enabled. The site is determined by the label of each row.

Methods

The class defines the following methods:

__construct()

Constructor.

Signature

  • It accepts the following parameter(s):
    • $wrapped (string|Metric) — The metric used to calculate the evolution.
    • $pastData (DataTable) — The data in the past to use when calculating evolutions.
    • $evolutionMetricName (string|Piwik\Plugins\CoreHome\Columns\Metrics\false) — The name of the evolution processed metric. Defaults to $wrapped's name with '_evolution' appended.
    • $quotientPrecision (int) — The percent's quotient precision.

getName()

Signature

  • It does not return anything.

getTranslatedName()

Signature

  • It does not return anything.

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.

format()

Signature

  • It accepts the following parameter(s):

  • It does not return anything.

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.

beforeComputeSubtable()

Signature

  • It accepts the following parameter(s):

    • $row (Row) —
  • It does not return anything.

afterComputeSubtable()

Signature

  • It accepts the following parameter(s):

    • $row (Row) —
  • It does not return anything.

getPastRowFromCurrent()

public for Insights use.

Signature

  • It accepts the following parameter(s):

    • $row (Row) —
  • It does not return anything.