API Documentation: Analytics Actions

All requests are done via HTTP POST to https://www.wellcomemat.com/ and will return a JSON response. If you would like the API to do something that is not listed here, visit our Help.

NOTES
1. Authentication parameters are also required for each request.
2. Required fields are marked with an asterisk.

Actions

  1. Views
  2. Impressions
  3. Chapters
  4. Breakdown
  5. Popular

Views: /api/analytics/views.php

This endpoint returns view data, separated by date and hash.
NOTES
1. You may only use one or none of the following parameters to select video view data: shared, hash, filter.

Views Parameters:

Parameter Name Definition Notes
key Key
secret Secret
start_date Start Date Format: "YYYY-MM-DD hh:mm:ss"
end_date End Date Format: "YYYY-MM-DD hh:mm:ss"
shared Shared Toggle Boolean: True / False for Rolled-Up Reporting
hash Media Hash Focuses view query on the given media hash.
filter Custom Filter Customer filters can be created ("vv.media_id = 214122").
debug Debug Toggle Boolean: True / False for server-side diagnostic logging.

Impressions: /api/analytics/impressions.php

This endpoint returns view/impression data.
NOTES
1. You may only use one of the following parameters (because they all select video impressions data differently): shared, hash, filter.
2. This currently includes YouTube views but not YouTube impressions, making some returned datasets inaccurate.

Impressions Parameters:

Parameter Name Definition Notes
key Key
secret Secret
start_date Start Date Format: "YYYY-MM-DD hh:mm:ss"
end_date End Date Format: "YYYY-MM-DD hh:mm:ss"
shared Shared Toggle Boolean: True / False for Rolled-Up Reporting
hash Media Hash Focuses view query on the given media hash.
filter Custom Filter Customer filters can be created ("vv.media_id = 214122").
debug Debug Toggle Boolean: True / False for server-side diagnostic logging.

Chapters: /api/analytics/chapters.php

This endpoint returns chapters and chapter clicks.
NOTES
1. Both total clicks and click data separated by time are returned.

Chapters Parameters:

Parameter Name Definition Notes
key Key
secret Secret
start_date Start Date Format: "YYYY-MM-DD hh:mm:ss"
end_date End Date Format: "YYYY-MM-DD hh:mm:ss"
shared Shared Toggle Boolean: True / False for Rolled-Up Reporting
debug Debug Toggle Boolean: True / False for server-side diagnostic logging.

Popular: /api/analytics/popular.php

This endpoint returns popular video data. You can specify the number of popular videos to return with the num parameter.
NOTES
1. You may only use one of the following parameters (because they all select popular video data differently): shared, hash, filter.

Popular Parameters:

Parameter Name Definition Notes
key Key
secret Secret
start_date Start Date Format: "YYYY-MM-DD hh:mm:ss"
end_date End Date Format: "YYYY-MM-DD hh:mm:ss"
shared Shared Toggle Boolean: True / False for Rolled-Up Reporting
hash Media Hash Focuses view query on the given media hash.
filter Custom Filter Customer filters can be created ("vv.media_id = 214122").
num Number of Results Select the number of returned results.
debug Debug Toggle Boolean: True / False for server-side diagnostic logging.

Device and Traffic Breakdown: /api/analytics/breakdown.php

This endpoint returns device and traffic data.
NOTES
1. You may only use one of the following parameters (because they all select popular video data differently): shared, hash, filter.
2. Traffic data is separated by base referrer URL.
3. Device data is separated by device type.

Popular Parameters:

Parameter Name Definition Notes
key Key
secret Secret
start_date Start Date Format: "YYYY-MM-DD hh:mm:ss"
end_date End Date Format: "YYYY-MM-DD hh:mm:ss"
shared Shared Toggle Boolean: True / False for Rolled-Up Reporting
hash Media Hash Focuses view query on the given media hash.
filter Custom Filter Customer filters can be created ("vv.media_id = 214122").
debug Debug Toggle Boolean: True / False for server-side diagnostic logging.

Rendering a chart

The google_chart field in responses can be used to display a Google Chart of your choosing. Here's an example with views but see Google's quick start for a proper introduction.

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
    var el = document.getElementById('chart-views'),
    chart = new google.visualization.LineChart(el),
    options = {
        legend: { position: 'none' },
        lineWidth: 2,
        pointSize: 0
    };

    data = google.visualization.arrayToDataTable(views, true); // 'views' here is the JSON
    chart.draw(data, options);
</script>
Close