API Documentation: Analytics Actions
Actions
Views: /api/analytics/views.php
This endpoint returns view data, separated by date and hash.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.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.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.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.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>