Power BI Custom Connector: Youtube Analytics

by miguel on ‎07-13-2017 12:51 PM

 Intro: about Miguel Escobar

 

image.png

 

Hi! And thank you for reading this blog post. My name is Miguel Escobar and I’m one of the authors of the book ‘M is for Data Monkey’ and co-founder of the PowerQuery.Training project. I also hold the MVP distinction and since 2013 I’ve been acting as an international BI consultant working with the Power BI family of tools starting with Power Pivot and more recently with Custom Data Connectors using Power Query and its ‘M’ language.

 

Recently Microsoft made publicly available a preview feature called ‘Custom Connectors’ and I spent 2 weeks, after that announcement, reading the tutorials from Microsoft and creating my own Custom Connector for my Youtube Channel until it was fully documented and in its final stage.

 

I won’t bore you with a long technical blog post about how I created a Custom Connector (you can read everything about it on my github repo), but I can testify that is actually pretty easy to create a custom connector once you understand the basics of the extensibility mode and my intention with this blog post is to encourage you to try out my Custom Connector and perhaps create yours as well.

What are Custom Connectors?

Whenever you start Power BI Desktop and go through the ‘Get Data’ Experience, you see a list of Data sources that you can connect to. Each of the elements that you see in the Get Data Experience is essentially a Data Connector that comes out of the box in Power BI Desktop.

 

A custom connector is basically a Connector that you can add to this ‘Get Data’ window so you can connect to a data source of your choice, with your own logic and with multiple options for type of credentials like the ones that you’re familiar with like Windows, basic and database authentication to even setting up your own OAuth 2.0 workflow.

 

You create these custom connectors with the same language that Power Query (Get and Transform for Excel 2016) uses, which is a language called ‘M’.

 

Here's a list of the key capabilities that a custom connector can bring:

  • Creating a business analyst friendly view for a REST API
  • Providing branding for a source supported by an existing connector (such as an OData service, or ODBC driver)
  • Implementing an OAuth v2 authentication flow for a SaaS offering
  • Exposing a limited/filtered view over your data source to improve usability
  • Supporting different authentication modes when creating a Power BI Content Pack
  • Enabling DirectQuery for a data source via an ODBC driver

Here’s a previous article on what Custom Connectors are and what capabilities it could bring to your Get Data experience.image.pngHow a Custom Connector will show up in the 'Get Data' WindowHow can I create a Custom Connector?

 

Here’s a list of what you’ll need:

  • Good knowledge of the M language
  • Latest version of the Power BI Desktop (June 2017)
  • Visual Studio 2015 or 2017
  • The Power Query SDK extension
  • Fiddler for Web calls tracing
  • Depending on your data source, you might need to read a lot of documentation to understand the best way to query your data
  • Patience….!

You can get started with the tutorials posted by Matt Mason on his TripPin series here and also the whole documentation found at their Github repo here.

The basic installation would require you to have Visual Sutdio with the Power Query SDK and with that you’ll be able to create a new Data Connector Project from within Visual Studio. The project will automatically start with the needed information that you just simply need to fill out in order to create your first Custom Connector.

image.pngThe .pq file is the one that has all the logic of your connector

What can I do with a Custom Connector? Show me some examples!

I’m a pretty visual person, so I’d like to show you with some images what a custom connector like the one that I created for the Youtube Data API and the Youtube Analytics API with OAuth 2.0 looks like:

 

image.pngCustom Table Navigation for the elements exposed in the Connector

image.pngFully documented function with sample values for parameters

image.pngYoutube Channel Summary

image.pngAttempt at creating a benchmark for videos with the tag "Power BI"image.pngReport for the Performance of a video

If you have a Youtube Channel and would like to give this connector a try, then click the button below to find out more information on how to get this connector and its companion Report Template. If you need help with a custom connector you can also contact me through Github! Looking forward to hearing from you.

image.png

Comments
by chinmayapatra99 Visitor
on ‎08-29-2017 05:13 AM

Please help me to connect azure analysis service from power bi desktop. I have a conncetion string to azure. I  used the string to connect azure analysis services from local power bi desktop . Unfortunately it says that "exception thrown by the target of an invocation". When i try this from a VM to connect it is connecting. Please help

 

or mail me

 

chinmayapatra999@gmail.com

 
by miguel
on ‎08-29-2017 05:24 AM

Hey,

 

A few suggestions:

  • Download the latest version of Power BI Desktop
  • From Azure, grab the servername of Azure Analysis Services instance
  • From Power BI Desktop, use the From Analysis Services option and enter the servername of the AAS server that you have
  • From the authentication window, select the Organizational account which will prompt you with the AAD log in window

I haven't had any issues connecting to Azure Analysis Services, but if none of the suggestions work I suggest you post your question on the Power BI forum or contact the support help desk

by thomaswhite Occasional Visitor
on ‎09-04-2017 11:42 PM

A few suggestions:

  • Download the latest version of Power BI Desktop
  • From Azure, grab the servername of Azure Analysis Services instance
  • From Power BI Desktop, use the From Analysis Services option and enter the servername of the AAS server that you have
  • From the authentication window, select the Organizational account which will prompt you with the AAD log in window
by Alberto Visitor
on ‎10-01-2017 04:13 AM

 

Hi Miguel, 

 

How can I get the youtube connector ?

 

Thank you beforehand for your tieme and consideration. 

 

Alberto

by miguel
on ‎11-03-2017 04:48 AM

Hey Alberto,

 

Sorry about the late reply. You can click on the last image of the post to find out more on how to get the custom connector.

 

 

by mohammadali1987 New Member
on ‎11-09-2017 03:47 AM

Please help me to configuring incoming mail servers to Odoo. Odoo Vat software are unable to connect to mail server please help me.

by joeysun Visitor
on ‎12-06-2017 06:33 AM

Hi Miguel,

 

Thanks for posting this helpful report. However, is there any way of scheduling automatic data refreshes in Service? Currently, this is not possible as Power BI returns the error stating that the data source is unsupported. 

 

Hope to hear from you!

Joey

by polikim Frequent Visitor
on ‎03-11-2018 09:14 PM

Please help below error.

 

K-20180312-476289.jpg

by miguel
on ‎03-12-2018 07:51 AM

Hey polikim,

 

It seems that you haven't configured correctly the Connector. That error is usually prompted when the .json file within the file hasn't been configured. I encourage you to go through the configuration of the .mez file again and if you ahve any questions please post them on the issues section of the github repo for better tracking.

 

BesT!

by polikim Frequent Visitor
on ‎03-12-2018 04:41 PM

Thank you, miguel.

by polikim Frequent Visitor
on ‎03-14-2018 01:21 AM

K-20180314-620746.jpg

 

 

 

 

 

 

 

 

 

In your Youtube Analytics Template.pbit, "Access to the resource is forbidden" error is occured.

// DailyVideoStats

 

please help ~ how to fix it.

 

 

by miguel
on ‎03-14-2018 05:27 AM

Hey Polikim,

 

Please go ahead and create a new issue on the github repo to track this and provide support. Alternatively, you can check this other issue that was raised with the similar error

by mariaalbert Occasional Visitor
on ‎04-19-2018 01:02 AM
Initial concept thru prototyping, trying out, manufacturing and set up, we paintings intently together with yourdevelopment crew to discover the proper  essay help solution that completely fits your precise desires. With huge revel in spanning a spectrum of industries and specialised conditions, our professionals have developed custom connector and cabling solutions for a diffusion of projects, including disposable designs for clinical system packages, miniature connectors for harsh environments.
by happywheelsgame Occasional Visitor
on ‎06-02-2018 12:33 AM

I was born in united states but grew up in New York.  happy wheels. These are probably my two favorite games of all time, and I'm trying my best to make it in the top 1-3 of google. geometry dash  basketball legends game

by angelicamandy Visitor
on ‎07-20-2018 03:04 AM

 

YouTube analytics is a very not reliable system to check the stats on your video. The whole YouTube site is not working anymore as good as it did in the past. View counts cannot be trusted anymore when there are sites that for a cash payment will give you more view counts on your video. More Cash more views. So with that happening analytics cannot keep up Write my essay for me UK Online.

by jresnick Occasional Visitor
on ‎08-21-2018 11:46 AM

Hi, thank you very much for your connector and report template! My only question is in the discrepancy I'm seeing between the total views from my Creator Studio view in YouTube and the TotalViews calculation in PowerBI. The PowerBI dashboard shows about 60k less views, any idea why that would happen? I'm trying to dig in more to investigate.

by charlesainsley Visitor
on ‎09-05-2018 03:34 AM

With energy BI this task is solved as it robotically extracts facts from all sources and brings it to a unified viewing pane. you may rapidly prepare statistics and broaden complete charts that will help you understand in element what your statistics indicate. considering that power BI is hosted in the cloud, you get entry to on your statistics and charts from anywhere, at any factor in time, and on any tool. Even sharing and participating on files with your colleagues in actual time at once interior electricity BI is viable. Top Coursework Writing Service

by avin4you2 Visitor
on ‎09-14-2018 01:43 AM

Hi, I am new to Power BI and trying to connect my Youtube data to PBI. This is by far the best solution that I came across. 

I went through the documentaion and found out that the connector is utilizing youtube Analytics API to fetch data. Can't we utilize the Youtube Reporting API as it is more valuable if we need to import data as Bulk. Can you please supply a suggestion for how to modify your m query to utilize youtube Reporting API?

Thanks

by miguel
on ‎09-15-2018 05:02 PM

Hey avin4you2,

 

I've read through the documentation of the Reporting API before choosing the Analytics API route and they 2 different APIs each with their own endpoints, so it'll be like creating the custom connector almost from scratch.

The reason why I chose this route is that the Reporting API relies on jobs that create a dataset for you - this is amazing if you have a full blown ETL system that can poll the API every now and then and once the job is ready donwload the data set and do an import to a database or storage system. You'll notice that this type of workflow is quite different to the one that the Analytics API has where you simply query get data and get it right away.

The latter, YouTube Analytics API, is what all of the REST API connectors inside of Power BI Desktop do and it does provide the best user experience to someone who doesn't know anything about the Reporting API nor does want to manage that Reporting API quota.

by avin4you2 Visitor
on ‎09-18-2018 07:39 PM

Hi miguel,

 

Thanks for responding. My only concern is, Youtube Analytics API is providing us processed data. Which means, for e.g, if I want to see overall Device Performance and then what videos have been viewed from those Devices, I have to generate two seperate requests to achieve this. Hence required the Youtube reporting API, which can provide us Raw information. 

I understand you put lots of efforts to create this. and its really amazing. 

 

Regards,

Avinash Dubey