Last updated: Sep-20-2023
You can access the analytics by opening the Video sub-menu in your Cloudinary Console and selecting Analytics. Here, you will be presented with a set of metrics and graphs that show how your video content has been delivered, including:
- Plays: The total number of video plays during the specified time period. This show the popularity of your video content.
- Unique Viewers: The total number of individual users who have watched a video during the specified time period. This offers insights into the reach of your video content.
- Watch Time: The total duration viewers have spent watching all of your videos. This is another indicator of video content reach.
- Watch Rate: The percentage of total time videos have been watched in relation to the total duration. This can be used to identify which videos are the most engaging.
- Play Rate: The percentage of video plays in relation to the number of times the video player was loaded. This can be used to highlight any issues with discoverability of videos.
Other more specific metrics include:
- Top Videos: The most popular videos based on the number of views. This helps identify your best-performing content.
- Top Devices / OS / Browsers / Countries: A set of graphs showing how your video content is consumed. This offers insights into the demographics of your users, and can be used to optimize the formats and sizes you use to deliver your videos.
You can also export all of the data as a CSV from the UI or programmatically retrieve video analytics data using our Video Analytics API.
1. Install the package:
2. Import the library:
3. Connect the analytics:
Connect the analytics by calling the
connectCloudinaryAnalytics method and provide the video element as a parameter. For example, if your video element has the id
4. Start tracking:
Start tracking analytics for any Cloudinary video by calling the
Alternatively, to track each video manually, call the
startManualTracking method, providing your Cloudinary cloud name and the public ID of the video you want to manually track:
- Auto and manual tracking cannot be used together for the same video element. Manual tracking should only be used in cases where you need to track certain videos, you want to track a video tag element which is dynamic, or you have custom domains which require providing
- Manual tracking may be required for videos where the public ID or cloud name aren't able to be automatically identified.
- When using manual tracking, you'll need to call
startManualTrackingwhenever the video source is changed, this will end the previous session and start a new one for the new video.
To retrieve analytics data for your video views programmatically, make use of our Video Analytics API. Get detailed information about all of the views your videos have received, and use expressions to limit the results based on certain conditions such as public ID and when the view ended. You can use the returned data as part of your own analytics systems or dashboards.
The API uses Basic Authentication, and your Cloudinary API Key and API Secret (which can be found on the Dashboard page of your Cloudinary console) are used for the authentication. Send your credentials as part of the request header, for example:
Authorization: Basic <your basic auth token>
Where your basic auth token is a base64-encoded
The base URL to access video analytics data is:
||String||A set of conditions used to limits the results to rows that match those conditions. See the expressions section for more details.|
||Integer||Specifies the number of items to include in the response. Default:
||String||The value to be used to obtain the next batch of results.|
||String||Specifies the expression field by which to sort the results. Possible fields:
- Retrieve video views data for the video with the public id
- Retrieve video views data for videos with a duration greater than 10 seconds and view ended date less than (older than) the UNIX timestamp
The Video Analytics API is currently not supported by our SDKs, but you can make a direct call to the API as shown in the examples above.
The response includes a
data array, where each entry is an object containing information about a specific video view, along with a request ID and the next cursor value.
Here's an example response:
The expressions parameter is used to limit the results based on a set of provided conditions.
The available fields for refining your queries, all except
view_ended_at can also be queried for null values.
||The date when the video view ended as a UNIX timestamp.|
||The full public ID of the video, including folder names when relevant.|
||The duration in seconds of the video.|
||The application used to view the video.|
||The 2-digit ISO country code of the viewer location.|
||The full identifier for the viewers operating system.|
||The length of time the video was viewed.|
Operators allow you to both define the relationship between the field and the value and combine expressions using the boolean AND operator.
The field operators you can use will vary depending on the field type, with the following operators available:
=- finds results where the value is an exact match, can be used with all fields
<- finds results where the value is less than the given condition
>- finds results where the value is greater than the given condition
AND operator can be used to combine expressions, for example:
video_public_id=skate AND view_ended_at<1695037024
If you'd like to capture custom analytics to pass to your Google Analytics account or other analytics trackers, you can manually push any events exposed by the Video Player.
You can either set the analytics parameter to
true, which monitors all available events except
percentplayed is monitored), or you can specify the specific events you want to monitor, including additional event sub-settings where relevant (
'percentsplayed', percents and
'timesplayed', times. See example below).
You will then need to send the analytics to your chosen service, for example Google Analytics. See the relevant analytics documentation for more information on how to send the chosen metrics.