Quantcast
Channel: Matomo forums - Latest topics
Viewing all articles
Browse latest Browse all 13999

Adding metrics in plugin

$
0
0

@rivoduck wrote:

Hello!

I am creating a plugin to track metrics related to media streaming (eg. play_time, session_id, streaming_protocol) and to generate a simple report taking these metrics into account (eg. consolidating connection count by session_id).

I am taking inspiration from the bandwidth plugin which I also require in order to track bandwidth.

My question is:
Should I add my new metrics the same way the bandwidth plugin does or should I use custom dimensions?

The bandwidth plugin defines its new metrics with this code:

class Metrics
{

    const METRICS_PAGE_SUM_BANDWIDTH = 1090;
    const METRICS_PAGE_MIN_BANDWIDTH = 1091;
    const METRICS_PAGE_MAX_BANDWIDTH = 1092;
    const METRICS_NB_HITS_WITH_BANDWIDTH = 1093;

    const COLUMN_TOTAL_OVERALL_BANDWIDTH  = 'nb_total_overall_bandwidth';
    const COLUMN_TOTAL_PAGEVIEW_BANDWIDTH = 'nb_total_pageview_bandwidth';
    const COLUMN_TOTAL_DOWNLOAD_BANDWIDTH = 'nb_total_download_bandwidth';
    [...]

If I go the same way as the Bandwidth plugin, how I can choose the index numbers so that they do not collide with any other metric?

If I go the way of the custom dimensions, how can I pick the ID of the custom dimension and how do I tell for which website it should be present?

Thank you,
Andrea

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 13999

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>