Event Categories - Total Value vs. Avg Value


(dakotareese) #1

Hi, I’m relatively new to Piwik and am about to dive into either customizing the existing Event Categories widget or cloning it to create a new one.

Basically the requirement is to display Avg Event Value instead of Total Value within the widget’s data table.

Any tips for a newbie on the best way to approach this?

Thanks.


(Matthieu Aubry) #2

Hi there,

Below the Event report, click on the icon “Display a table with visitor engagement metrics” which will display the “Average value” column. Is this sufficient to solve your issue?


(dakotareese) #3

Thanks for the reply. The main issue is that the only thing we’re using event values for is user ratings for several pieces of content (highly similar to the implementation tutorial actually).

The sum of these values just doesn’t provide value. Today we had 168 ratings for a total of 1,545. Even though we just deployed today, displaying this value on our dashboard is confusing people.

Digging into it a bit more today, it looks like my best bet is to change ‘sum_event_value’ to ‘avg_event_value’ line in this snippet from Events.php:

            $view->config->columns_to_display = array('label', 'nb_events', 'sum_event_value');
        }```

Assuming it works (I'll have to test it tomorrow), it should do the job. It is a pity though that it isn't configurable in the UI.

The bummer, of course being, that we'll no longer be able to auto-update.

(Matthieu Aubry) #4

@dakotareese what you’re trying to achieve is legitimate and important use case. Would you mind creating an issue on our tracker @ Issues · matomo-org/piwik · GitHub and describe your use cases / challenges with current solution? we could try to find a product improvement that solves this use case nicely