Create Custom YouTube Dashboards

YouTube is one of the most powerful social media marketing platforms used by businesses around the world to reach and engage customers. Creating a custom analytics dashboard is often required to monitor your subscribers’ engagement with the content in your channel. Let’s see how to build a simple analytics dashboard to show the key metrics of your YouTube channel all in one place.

APIs overview

Google offers two different types of APIs that allow you gather the essential information from your channel:

The YouTube Reporting and Analytics APIs let you retrieve YouTube Analytics data to automate complex reporting tasks, build custom dashboards, and more. The YouTube Data API helps you search for videos matching specific search terms, topics, locations, and publication dates.

Syncfusion Dashboards support both types of API for building your custom dashboards. To build dashboards from an analytics API, use the ‘Google Analytics’ connection in the data connections wizard. This connection extracts only the essential information from the response and ignores the other metadata.

Syncfusion YouTube Dashboards Connector for Analytics API
Google Analytics Connector for YouTube Analytics

The dedicated YouTube connection lets you connect to the Data API.

Syncfusion YouTube Dashboard Connector for Data API
YouTube Data API Connector

Building the Dashboard

Using the Analytics API, we are about to build a simple dashboard with key metrics, as shown in the following image.

Custom YouTube Dashboard Built Using Syncfusion Dashboards
Custom YouTube Analytics Dashboard

Building the API

To start with, let’s build the required query using the Reporting API. Please refer to this documentation link to learn more about the report query.

The following API is used to fetch YouTube reports.

HTTP request

GET

https://youtubeanalytics.googleapis.com/v2/reports

The API accepts several parameters that can be configured. Please refer to the previous link for the complete details of optional and required parameters. The following table explains how to include the mandatory parameters in the API query.

Parameter Description
ids Identifies the YouTube channel or content owner for which you are retrieving YouTube Analytics data.

  • For your own channel, use ‘channel==MINE’
  • For a content owner, use ‘contentOwner==OWNER_NAME’, where OWNER_NAME is the content owner ID for the user.
metrics A comma-separated list of YouTube Analytics metrics, such as views, likes, or dislikes. Refer to this page on reporting for the complete list of metrics available.

Choose the list of metrics required and add the parameters in the query.

startDate The start date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format.
endDate The end date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format.

Also, optional parameters, such as dimensions, filters, and currency, can be added if you need to narrow down the report to a specific criterion.

Dimensions are comma-separated lists of YouTube Analytics dimensions, such as video, ageGroup, or gender. The Dimensions document contains definitions for all the dimensions. Since our dashboard is going to be built upon the time series, the ‘day’ dimension can be used.

The final API query is built, as shown in the following.

https://youtubeanalytics.googleapis.com/v2/reports?ids=channel%3D%3DMINE&metrics=views,comments,likes,dislikes,shares,averageViewDuration,subscribersGained,subscribersLost&startDate=2018-10-01&endDate=2019-10-01&dimensions=day

Creating a data source

Secondly, let’s use this API and start building our dashboard.

In your dashboard’s home page, click the New Dashboard menu and select the Blank Dashboard option. In the dashboard designer application, open the data connection wizard in the right panel and choose New Data Source.

New data source connection wizard of Syncfusion Dashboards
Creating a new data source

Choose Google Analytics from the list of connections and authenticate with your Google account.

Google Analytics Connection wizard for YouTube Dashboards
Creating a Google Analytics Connection

Once authorized, add the URL in the connection wizard and choose your refresh time interval.

Google Analytics Connection Wizard
Google Analytics Connection Wizard

In the preview pane, check your results and click Connect. Eventually, the data source designer will open and you can drag your table to the design canvas. Since the response contains all the data in string format by default, modify the data type of the fields. Modify the day field to Date and other metrics to Integer.

Formatting window to change the data type
Formatting the data

Finally, provide a name for your data source and click Save.

Configuring Visuals

You can see the prepared data source in the data sources list.

First, let’s configure the cards to show key metrics. Drag the cards to the design canvas and start building the dashboard. Click the Widget Settings icon in the card and add the required metrics to the Actual Value column. Modify the title and properties as required.

Configuring the card widgets to show the key metrics
Configuring the card widget

Similarly, configure the other card widgets with the required key metrics to be displayed.

YouTube dashboard with the card displaying key metrics
Cards displaying the key metrics

Likewise, let’s configure a spline chart to show the total views by date. Drag a spline chart to the design canvas and configure it by adding the day field to the columns section and the views field to the values section. Modify the aggregation of the day field to show the data by date.

Adding a spline chart in the YouTube dashboard to show the total views
Configuring the spline chart

Modify the other properties and widget titles to customize the visualization.

Similarly, add a column chart to show the details of subscribers and unsubscribers by date. Configure the widget by dragging the day field to the columns and the subscribersgained and subscribersLost fields to the values.

Adding a column chart in the YouTube dashboard to show subscriber details
Adding a column chart

Add another column chart to show the average view duration, as shown in the following.

YoutTubeDashboard with the column chart showing the average view duration.
Displaying the average view duration

Finally, let’s add a visualization to show the total views by geographic location. Create a new data source with the country dimension to show the views by country. The API will look like the following.

https://youtubeanalytics.googleapis.com/v2/reports?ids=channel%3D%3DMINE&metrics=views,averageViewDuration&startDate=2018-10-01&endDate=2019-10-01&dimensions=country

Add a choropleth map to the dashboard and configure it by dragging the country field to the shape section and the views field to the values section. Since the country column contains the country code, open the properties section and choose iso_3166_2 in the column option.

Adding a choropleth map in the YouTube dashboards to show views by country
Configuring a choropleth map

Conclusion

Finally, the dashboard preparation is complete. You can save the dashboard, share it, and collaborate with other users in the application. The data in the dashboard refreshes continuously based on the chosen time interval, helping you keep track of the latest updates. You can also combine your YouTube data with the Google Analytics data and analyze your channel the same way you would analyze your website. As a result, you can get more insights on top videos, top converting geographies, top referring traffic channels, and more.

In conclusion, we hope this blog post provided you needed information on how to retrieve the analytics data for your YouTube channel and build dashboards using it. We hope you enjoyed it and stay tuned to read upcoming posts on how to build interactive business dashboards.

Tags:

Share this post:

Related Posts

Leave a comment