You need to register your application with Google to be able to use OAuth 2.0 authorization. The following steps explain how to register your application and create an OAuth 2.0 client ID to use in that application.
Create your project and select API services
-
Create a project in the Google APIs Console.
-
If you have not created a project before, the Console page displays a big
Create projectbutton.
-
If you have created a project before, you can create a new project via the Console menu shown below.

-
-
The console displays the Services pane, which shows a list of the Google API services that your application could use. Toggle the status for the YouTube Analytics API service to
ON. (You may need to read and accept a license agreement to complete this step for certain services.)