You are here

public function Product::addMetric in Commerce Google Tag Manager 8.2

Same name and namespace in other branches
  1. 8 src/Product.php \Drupal\commerce_google_tag_manager\Product::addMetric()

Add a custom metric.

Parameters

string $metric: The metric to add.

Return value

\Drupal\commerce_google_tag_manager\Product The Product object.

File

src/Product.php, line 304

Class

Product
Represents a product in the domain of Google's Enhanced Ecommerce.

Namespace

Drupal\commerce_google_tag_manager

Code

public function addMetric($metric) {
  $this->metrics[] = $metric;
  return $this;
}