Skip to content

E-Commerce Reports should not aggregate data to "-1" #3116

@anonymous-matomo-user

Description

@anonymous-matomo-user

We are using the ecommerce feature of Piwik for our websites and have noticed that items are aggregated to "-1". This occurs in both UI and API for "Product SKU" and "Product Name" reports.

This piece of code simulates just some product views and a purchase so that the ecommerce report shows up in the UI:

var piwikTracker = Piwik.getTracker("http://localhost/piwik/piwik.php", 1);

for (i = 0; i < 100; i++) {
  piwikTracker = Piwik.getTracker("http://localhost/piwik/piwik.php", 1);
  piwikTracker.setEcommerceView("id_book"+i, "Book"+i, "Books", 7.50);
  piwikTracker.trackPageView();
}

piwikTracker = Piwik.getTracker("http://localhost/piwik/piwik.php", 1);
piwikTracker.addEcommerceItem("id_book1",  "Book1", "Books", 7.50, 1);
piwikTracker.trackEcommerceOrder("order1",7.50);
piwikTracker.trackPageView();

The data attached in the CSV has been generated using the code above. As you can see, some product views are missing, e.g. everything after id_book52 as well as id_book6 to id_book9. The information itself is correctly in the database.

The huge negative impact of this aggregation is not visible: There are 10 visits in sum to id_book60, but it also aggregates to "-1" and does not show up in the report. So you cannot see products which are converting bad if you have a lot of products in your store.

If the config value "datatable_archiving_maximum_rows_subtable_referers" is set higher than 50, data is no longer aggregated and we see all product views correctly. However I assume raising this value might affect the UI in other views in a negative way.

Would it be possible to implement one of the following options?

  1. Ignore the parameter, i.e. do not aggregate the data in ecommerce reports
  2. Introduce an own parameter for the ecommerce reports
  3. Only aggregate data with "visits = 1" and rename "-1" to something more meaningful like "Products with only 1 Visit"

Keywords: ecommerce, aggregation, -1

Metadata

Metadata

Assignees

Labels

BugFor errors / faults / flaws / inconsistencies etc.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions