diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2019-11-18 10:08:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-18 10:08:16 +0300 |
commit | 60009312a44f1aa728a0f9f6f7e0a8a59068544d (patch) | |
tree | 2b037e8abdf08ed024946a6a841757162ea9443f /plugins/Ecommerce | |
parent | 12011166e3934f1d76f2d183a63cfe2ff9bde8e6 (diff) |
Add product name, product category, product sku, product price segments (#15144)
* Add product category segment.
* Fix productCategory action, add productName, productSku, productPrice segments.
* Hide productCategory1...5 segments in UI/API.
* fix tests
* Do not select conversion items that are deleted in segments + fix bug in ecommerce item insert (do not fail whole insert if one duplicate primary key is found).
* update expected files
* Fix unit test.
Diffstat (limited to 'plugins/Ecommerce')
25 files changed, 587 insertions, 0 deletions
diff --git a/plugins/Ecommerce/Columns/ProductCategory.php b/plugins/Ecommerce/Columns/ProductCategory.php index c745640b63..6ec80b649e 100644 --- a/plugins/Ecommerce/Columns/ProductCategory.php +++ b/plugins/Ecommerce/Columns/ProductCategory.php @@ -10,10 +10,55 @@ namespace Piwik\Plugins\Ecommerce\Columns; use Piwik\Columns\Dimension; use Piwik\Piwik; +use Piwik\Plugin\Segment; class ProductCategory extends Dimension { + const PRODUCT_CATEGORY_COUNT = 5; + protected $type = self::TYPE_TEXT; protected $category = 'Goals_Ecommerce'; protected $nameSingular = 'Goals_ProductCategory'; + + protected function configureSegments() + { + $individualProductCategorySegments = $this->getProductCategorySegments(self::PRODUCT_CATEGORY_COUNT); + + // add individual productCategoryN segments for use as a union (these segments are not available through the UI/API) + foreach ($individualProductCategorySegments as $i => $productCategoryName) { + $productCategoryColumnName = 'idaction_category'; + if ($i > 0) { + $productCategoryColumnName .= $i + 1; + } + + $segment = new Segment(); + $segment->setCategory($this->category); + $segment->setType('dimension'); + $segment->setName($this->getName() . ' ' . ($i + 1)); + $segment->setSegment($productCategoryName); + $segment->setSqlFilter('\\Piwik\\Tracker\\TableLogAction::getIdActionFromSegment'); + $segment->setSqlSegment('log_conversion_item.' . $productCategoryColumnName); + $segment->setIsInternal(true); + $this->addSegment($segment); + } + + // add a union of these individual columns as productCategory + $segment = new Segment(); + $segment->setCategory($this->category); + $segment->setType('dimension'); + $segment->setSegment('productCategory'); + $segment->setName($this->getName()); + $segment->setUnionOfSegments($individualProductCategorySegments); + $this->addSegment($segment); + } + + private function getProductCategorySegments($categoryCount) + { + $result = []; + for ($i = 0; $i < $categoryCount; ++$i) { + $segmentName = 'productCategory' . ($i + 1); + $result[] = $segmentName; + } + return $result; + } }
\ No newline at end of file diff --git a/plugins/Ecommerce/Columns/ProductName.php b/plugins/Ecommerce/Columns/ProductName.php index 64e2efd108..a4e28b4b42 100644 --- a/plugins/Ecommerce/Columns/ProductName.php +++ b/plugins/Ecommerce/Columns/ProductName.php @@ -21,6 +21,8 @@ class ProductName extends Dimension protected $nameSingular = 'Goals_ProductName'; protected $namePlural = 'Goals_ProductNames'; protected $category = 'Goals_Ecommerce'; + protected $sqlFilter = '\\Piwik\\Tracker\\TableLogAction::getIdActionFromSegment'; + protected $segmentName = 'productName'; public function getDbColumnJoin() { diff --git a/plugins/Ecommerce/Columns/ProductPrice.php b/plugins/Ecommerce/Columns/ProductPrice.php index 27a29405b9..5c9254675a 100644 --- a/plugins/Ecommerce/Columns/ProductPrice.php +++ b/plugins/Ecommerce/Columns/ProductPrice.php @@ -17,5 +17,6 @@ class ProductPrice extends Dimension protected $columnName = 'price'; protected $nameSingular = 'Goals_ProductPrice'; protected $category = 'Goals_Ecommerce'; + protected $segmentName = 'productPrice'; }
\ No newline at end of file diff --git a/plugins/Ecommerce/Columns/ProductSku.php b/plugins/Ecommerce/Columns/ProductSku.php index af09e765ca..bcf6109029 100644 --- a/plugins/Ecommerce/Columns/ProductSku.php +++ b/plugins/Ecommerce/Columns/ProductSku.php @@ -21,6 +21,8 @@ class ProductSku extends Dimension protected $nameSingular = 'Goals_ProductSKU'; protected $namePlural = 'Goals_ProductSKUs'; protected $category = 'Goals_Ecommerce'; + protected $sqlFilter = '\\Piwik\\Tracker\\TableLogAction::getIdActionFromSegment'; + protected $segmentName = 'productSku'; public function getDbColumnJoin() { diff --git a/plugins/Ecommerce/tests/System/EcommerceOrderWithItemsTest.php b/plugins/Ecommerce/tests/System/EcommerceOrderWithItemsTest.php index 630e67b7a1..d5809b3d01 100644 --- a/plugins/Ecommerce/tests/System/EcommerceOrderWithItemsTest.php +++ b/plugins/Ecommerce/tests/System/EcommerceOrderWithItemsTest.php @@ -268,6 +268,47 @@ class EcommerceOrderWithItemsTest extends SystemTestCase 'columns' => 'avg_order_revenue'), 'testSuffix' => '_AvgOrderRevenue')), + // product category segment + [array_merge(['VisitsSummary.get'], $goalItemApi), [ + 'idSite' => $idSite, + 'date' => $dateTime, + 'periods' => 'week', + 'testSuffix' => '_productCategorySegment', + 'segment' => 'productCategory==Tools', + ]], + + [array_merge(['VisitsSummary.get'], $goalItemApi), [ + 'idSite' => $idSite, + 'date' => $dateTime, + 'periods' => 'week', + 'testSuffix' => '_productNameSegment', + 'segment' => 'productName=@' . urlencode(urlencode('bought day after')), + ]], + + [array_merge(['VisitsSummary.get'], $goalItemApi), [ + 'idSite' => $idSite, + 'date' => $dateTime, + 'periods' => 'week', + 'testSuffix' => '_productSkuSegment', + 'segment' => 'productSku==' . urlencode(urlencode('SKU VERY nice indeed')), + ]], + + // deleted sku will be deleted + [array_merge(['VisitsSummary.get'], $goalItemApi), [ + 'idSite' => $idSite, + 'date' => $dateTime, + 'periods' => 'week', + 'testSuffix' => '_productSkuSegmentDeleted', + 'segment' => 'productSku==' . urlencode(urlencode('SKU WILL BE DELETED')), + ]], + + [array_merge(['VisitsSummary.get'], $goalItemApi), [ + 'idSite' => $idSite, + 'date' => $dateTime, + 'periods' => 'week', + 'testSuffix' => '_productPrice', + 'segment' => 'productPrice>500', + ]], ), self::getApiForTestingScheduledReports($dateTime, 'week') ); diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productCategorySegment__Goals.getItemsCategory_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productCategorySegment__Goals.getItemsCategory_week.xml new file mode 100644 index 0000000000..df23a6ffa1 --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productCategorySegment__Goals.getItemsCategory_week.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <label>Tools</label> + <revenue>200</revenue> + <quantity>2</quantity> + <orders>1</orders> + <avg_price>100</avg_price> + <avg_quantity>2</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> +</result>
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productCategorySegment__Goals.getItemsName_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productCategorySegment__Goals.getItemsName_week.xml new file mode 100644 index 0000000000..b271d3219f --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productCategorySegment__Goals.getItemsName_week.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <label>TRIPOD - bought day after</label> + <revenue>200</revenue> + <quantity>2</quantity> + <orders>1</orders> + <avg_price>100</avg_price> + <avg_quantity>2</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> +</result>
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productCategorySegment__Goals.getItemsSku_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productCategorySegment__Goals.getItemsSku_week.xml new file mode 100644 index 0000000000..83e2cd8798 --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productCategorySegment__Goals.getItemsSku_week.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <label>TRIPOD SKU</label> + <revenue>200</revenue> + <quantity>2</quantity> + <orders>1</orders> + <avg_price>100</avg_price> + <avg_quantity>2</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> +</result>
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productCategorySegment__VisitsSummary.get_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productCategorySegment__VisitsSummary.get_week.xml new file mode 100644 index 0000000000..a42ba7134f --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productCategorySegment__VisitsSummary.get_week.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_users>0</nb_users> + <nb_visits>1</nb_visits> + <nb_actions>0</nb_actions> + <nb_visits_converted>1</nb_visits_converted> + <bounce_count>1</bounce_count> + <sum_visit_length>363</sum_visit_length> + <max_actions>0</max_actions> + <bounce_rate>100%</bounce_rate> + <nb_actions_per_visit>0</nb_actions_per_visit> + <avg_time_on_site>363</avg_time_on_site> +</result>
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productNameSegment__Goals.getItemsCategory_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productNameSegment__Goals.getItemsCategory_week.xml new file mode 100644 index 0000000000..df23a6ffa1 --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productNameSegment__Goals.getItemsCategory_week.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <label>Tools</label> + <revenue>200</revenue> + <quantity>2</quantity> + <orders>1</orders> + <avg_price>100</avg_price> + <avg_quantity>2</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> +</result>
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productNameSegment__Goals.getItemsName_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productNameSegment__Goals.getItemsName_week.xml new file mode 100644 index 0000000000..b271d3219f --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productNameSegment__Goals.getItemsName_week.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <label>TRIPOD - bought day after</label> + <revenue>200</revenue> + <quantity>2</quantity> + <orders>1</orders> + <avg_price>100</avg_price> + <avg_quantity>2</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> +</result>
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productNameSegment__Goals.getItemsSku_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productNameSegment__Goals.getItemsSku_week.xml new file mode 100644 index 0000000000..83e2cd8798 --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productNameSegment__Goals.getItemsSku_week.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <label>TRIPOD SKU</label> + <revenue>200</revenue> + <quantity>2</quantity> + <orders>1</orders> + <avg_price>100</avg_price> + <avg_quantity>2</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> +</result>
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productNameSegment__VisitsSummary.get_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productNameSegment__VisitsSummary.get_week.xml new file mode 100644 index 0000000000..a42ba7134f --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productNameSegment__VisitsSummary.get_week.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_users>0</nb_users> + <nb_visits>1</nb_visits> + <nb_actions>0</nb_actions> + <nb_visits_converted>1</nb_visits_converted> + <bounce_count>1</bounce_count> + <sum_visit_length>363</sum_visit_length> + <max_actions>0</max_actions> + <bounce_rate>100%</bounce_rate> + <nb_actions_per_visit>0</nb_actions_per_visit> + <avg_time_on_site>363</avg_time_on_site> +</result>
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productPrice__Goals.getItemsCategory_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productPrice__Goals.getItemsCategory_week.xml new file mode 100644 index 0000000000..902e03555b --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productPrice__Goals.getItemsCategory_week.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <label>Electronics & Cameras</label> + <revenue>2500</revenue> + <quantity>3</quantity> + <orders>2</orders> + <nb_visits>1</nb_visits> + <nb_actions>3</nb_actions> + <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors> + <avg_price>1000</avg_price> + <avg_quantity>1.5</avg_quantity> + <conversion_rate>200%</conversion_rate> + </row> + <row> + <label>Multiple Category 1</label> + <revenue>1000</revenue> + <quantity>2</quantity> + <orders>1</orders> + <avg_price>500</avg_price> + <avg_quantity>2</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>Multiple Category 2</label> + <revenue>1000</revenue> + <quantity>2</quantity> + <orders>1</orders> + <avg_price>500</avg_price> + <avg_quantity>2</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>Multiple Category 4</label> + <revenue>1000</revenue> + <quantity>2</quantity> + <orders>1</orders> + <avg_price>500</avg_price> + <avg_quantity>2</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>Multiple Category 5</label> + <revenue>1000</revenue> + <quantity>2</quantity> + <orders>1</orders> + <avg_price>500</avg_price> + <avg_quantity>2</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>Product Category not defined</label> + <revenue>611.22</revenue> + <quantity>7</quantity> + <orders>2</orders> + <nb_visits>3</nb_visits> + <nb_actions>6</nb_actions> + <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> + <avg_price>55.61</avg_price> + <avg_quantity>3.5</avg_quantity> + <conversion_rate>66.67%</conversion_rate> + </row> + <row> + <label>Category TWO LEFT in cart</label> + <nb_visits>3</nb_visits> + <nb_actions>3</nb_actions> + <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> + <avg_price>0</avg_price> + <avg_quantity>0</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>second category</label> + <nb_visits>3</nb_visits> + <nb_actions>3</nb_actions> + <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> + <avg_price>0</avg_price> + <avg_quantity>0</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> +</result>
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productPrice__Goals.getItemsName_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productPrice__Goals.getItemsName_week.xml new file mode 100644 index 0000000000..5fcd96e6a0 --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productPrice__Goals.getItemsName_week.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <label>Canon SLR</label> + <revenue>1500</revenue> + <quantity>1</quantity> + <orders>1</orders> + <avg_price>1500</avg_price> + <avg_quantity>1</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>PRODUCT name</label> + <revenue>1011.22</revenue> + <quantity>3</quantity> + <orders>2</orders> + <nb_visits>1</nb_visits> + <nb_actions>1</nb_actions> + <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors> + <avg_price>255.61</avg_price> + <avg_quantity>1.5</avg_quantity> + <conversion_rate>200%</conversion_rate> + </row> + <row> + <label>PRODUCT name BIS</label> + <revenue>600</revenue> + <quantity>6</quantity> + <orders>1</orders> + <avg_price>100</avg_price> + <avg_quantity>6</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>PRODUCT TWO LEFT in cart</label> + <nb_visits>3</nb_visits> + <nb_actions>3</nb_actions> + <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> + <avg_price>0</avg_price> + <avg_quantity>0</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>PRODUCT THREE LEFT in cart</label> + <nb_visits>3</nb_visits> + <nb_actions>6</nb_actions> + <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> + <avg_price>1332</avg_price> + <avg_quantity>0</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> +</result>
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productPrice__Goals.getItemsSku_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productPrice__Goals.getItemsSku_week.xml new file mode 100644 index 0000000000..1e5611713b --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productPrice__Goals.getItemsSku_week.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <label>SKU2</label> + <revenue>1500</revenue> + <quantity>1</quantity> + <orders>1</orders> + <avg_price>1500</avg_price> + <avg_quantity>1</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>SKU VERY nice indeed</label> + <revenue>1011.22</revenue> + <quantity>3</quantity> + <orders>2</orders> + <nb_visits>3</nb_visits> + <nb_actions>7</nb_actions> + <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> + <avg_price>255.61</avg_price> + <avg_quantity>1.5</avg_quantity> + <conversion_rate>66.67%</conversion_rate> + </row> + <row> + <label>ANOTHER SKU HERE</label> + <revenue>600</revenue> + <quantity>6</quantity> + <orders>1</orders> + <avg_price>100</avg_price> + <avg_quantity>6</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>SKU IN ABANDONED CART TWO</label> + <nb_visits>3</nb_visits> + <nb_actions>3</nb_actions> + <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> + <avg_price>0</avg_price> + <avg_quantity>0</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> +</result>
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productPrice__VisitsSummary.get_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productPrice__VisitsSummary.get_week.xml new file mode 100644 index 0000000000..f0d70174e2 --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productPrice__VisitsSummary.get_week.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_users>0</nb_users> + <nb_visits>3</nb_visits> + <nb_actions>12</nb_actions> + <nb_visits_converted>2</nb_visits_converted> + <bounce_count>0</bounce_count> + <sum_visit_length>5763</sum_visit_length> + <max_actions>6</max_actions> + <bounce_rate>0%</bounce_rate> + <nb_actions_per_visit>4</nb_actions_per_visit> + <avg_time_on_site>1921</avg_time_on_site> +</result>
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegmentDeleted__Goals.getItemsCategory_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegmentDeleted__Goals.getItemsCategory_week.xml new file mode 100644 index 0000000000..c234bed59e --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegmentDeleted__Goals.getItemsCategory_week.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result />
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegmentDeleted__Goals.getItemsName_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegmentDeleted__Goals.getItemsName_week.xml new file mode 100644 index 0000000000..c234bed59e --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegmentDeleted__Goals.getItemsName_week.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result />
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegmentDeleted__Goals.getItemsSku_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegmentDeleted__Goals.getItemsSku_week.xml new file mode 100644 index 0000000000..c234bed59e --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegmentDeleted__Goals.getItemsSku_week.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result />
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegmentDeleted__VisitsSummary.get_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegmentDeleted__VisitsSummary.get_week.xml new file mode 100644 index 0000000000..32b66284be --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegmentDeleted__VisitsSummary.get_week.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_users>0</nb_users> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <nb_visits_converted>0</nb_visits_converted> + <bounce_count>0</bounce_count> + <sum_visit_length>0</sum_visit_length> + <max_actions>0</max_actions> + <bounce_rate>0%</bounce_rate> + <nb_actions_per_visit>0</nb_actions_per_visit> + <avg_time_on_site>0</avg_time_on_site> +</result>
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegment__Goals.getItemsCategory_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegment__Goals.getItemsCategory_week.xml new file mode 100644 index 0000000000..902e03555b --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegment__Goals.getItemsCategory_week.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <label>Electronics & Cameras</label> + <revenue>2500</revenue> + <quantity>3</quantity> + <orders>2</orders> + <nb_visits>1</nb_visits> + <nb_actions>3</nb_actions> + <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors> + <avg_price>1000</avg_price> + <avg_quantity>1.5</avg_quantity> + <conversion_rate>200%</conversion_rate> + </row> + <row> + <label>Multiple Category 1</label> + <revenue>1000</revenue> + <quantity>2</quantity> + <orders>1</orders> + <avg_price>500</avg_price> + <avg_quantity>2</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>Multiple Category 2</label> + <revenue>1000</revenue> + <quantity>2</quantity> + <orders>1</orders> + <avg_price>500</avg_price> + <avg_quantity>2</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>Multiple Category 4</label> + <revenue>1000</revenue> + <quantity>2</quantity> + <orders>1</orders> + <avg_price>500</avg_price> + <avg_quantity>2</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>Multiple Category 5</label> + <revenue>1000</revenue> + <quantity>2</quantity> + <orders>1</orders> + <avg_price>500</avg_price> + <avg_quantity>2</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>Product Category not defined</label> + <revenue>611.22</revenue> + <quantity>7</quantity> + <orders>2</orders> + <nb_visits>3</nb_visits> + <nb_actions>6</nb_actions> + <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> + <avg_price>55.61</avg_price> + <avg_quantity>3.5</avg_quantity> + <conversion_rate>66.67%</conversion_rate> + </row> + <row> + <label>Category TWO LEFT in cart</label> + <nb_visits>3</nb_visits> + <nb_actions>3</nb_actions> + <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> + <avg_price>0</avg_price> + <avg_quantity>0</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>second category</label> + <nb_visits>3</nb_visits> + <nb_actions>3</nb_actions> + <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> + <avg_price>0</avg_price> + <avg_quantity>0</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> +</result>
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegment__Goals.getItemsName_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegment__Goals.getItemsName_week.xml new file mode 100644 index 0000000000..5fcd96e6a0 --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegment__Goals.getItemsName_week.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <label>Canon SLR</label> + <revenue>1500</revenue> + <quantity>1</quantity> + <orders>1</orders> + <avg_price>1500</avg_price> + <avg_quantity>1</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>PRODUCT name</label> + <revenue>1011.22</revenue> + <quantity>3</quantity> + <orders>2</orders> + <nb_visits>1</nb_visits> + <nb_actions>1</nb_actions> + <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors> + <avg_price>255.61</avg_price> + <avg_quantity>1.5</avg_quantity> + <conversion_rate>200%</conversion_rate> + </row> + <row> + <label>PRODUCT name BIS</label> + <revenue>600</revenue> + <quantity>6</quantity> + <orders>1</orders> + <avg_price>100</avg_price> + <avg_quantity>6</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>PRODUCT TWO LEFT in cart</label> + <nb_visits>3</nb_visits> + <nb_actions>3</nb_actions> + <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> + <avg_price>0</avg_price> + <avg_quantity>0</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>PRODUCT THREE LEFT in cart</label> + <nb_visits>3</nb_visits> + <nb_actions>6</nb_actions> + <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> + <avg_price>1332</avg_price> + <avg_quantity>0</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> +</result>
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegment__Goals.getItemsSku_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegment__Goals.getItemsSku_week.xml new file mode 100644 index 0000000000..1e5611713b --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegment__Goals.getItemsSku_week.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <label>SKU2</label> + <revenue>1500</revenue> + <quantity>1</quantity> + <orders>1</orders> + <avg_price>1500</avg_price> + <avg_quantity>1</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>SKU VERY nice indeed</label> + <revenue>1011.22</revenue> + <quantity>3</quantity> + <orders>2</orders> + <nb_visits>3</nb_visits> + <nb_actions>7</nb_actions> + <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> + <avg_price>255.61</avg_price> + <avg_quantity>1.5</avg_quantity> + <conversion_rate>66.67%</conversion_rate> + </row> + <row> + <label>ANOTHER SKU HERE</label> + <revenue>600</revenue> + <quantity>6</quantity> + <orders>1</orders> + <avg_price>100</avg_price> + <avg_quantity>6</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> + <row> + <label>SKU IN ABANDONED CART TWO</label> + <nb_visits>3</nb_visits> + <nb_actions>3</nb_actions> + <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> + <avg_price>0</avg_price> + <avg_quantity>0</avg_quantity> + <conversion_rate>0%</conversion_rate> + </row> +</result>
\ No newline at end of file diff --git a/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegment__VisitsSummary.get_week.xml b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegment__VisitsSummary.get_week.xml new file mode 100644 index 0000000000..f0d70174e2 --- /dev/null +++ b/plugins/Ecommerce/tests/System/expected/test_ecommerceOrderWithItems_productSkuSegment__VisitsSummary.get_week.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_users>0</nb_users> + <nb_visits>3</nb_visits> + <nb_actions>12</nb_actions> + <nb_visits_converted>2</nb_visits_converted> + <bounce_count>0</bounce_count> + <sum_visit_length>5763</sum_visit_length> + <max_actions>6</max_actions> + <bounce_rate>0%</bounce_rate> + <nb_actions_per_visit>4</nb_actions_per_visit> + <avg_time_on_site>1921</avg_time_on_site> +</result>
\ No newline at end of file |