The Sisense YouTube Analytics connector is a standalone connector that allows you to import data from the YouTube Analytics API into the ElastiCube Manager. After you have downloaded and installed the connector, you can connect to the YouTube Analytics API through a connection string you provide Sisense in the ElastiCube Manager. The connection string is used to authenticate users who connect to the YouTube Analytics API. To obtain a connection string, you will need to create a YouTube Analytics app.
Once you have connected to YouTube Analytics, you can import a variety of tables from the YouTube Analytics API.
This page describes how to install the YouTube Analytics connector, how to connect to YouTube Analytics with a connection string, and what tables you can import into the ElastiCube Manager:
- Installing the YouTube Analytics Connector
- Connecting to the YouTube Analytics REST API
- Adding YouTube Analytics Tables to your ElastiCube
- YouTube Analytics Tables
Sisense provides the YouTube Analytics connector as a standalone connector that you can download and add to your list of default Sisense connectors.
To install the YouTube Analytics connector:
- Download the YouTube Analytics installation file.
- Open the installation file and click Install.
- After the installation process is complete, click Close.
The YouTube Analytics connector is displayed in the ElastiCube Manager under Add Data > Web Services.
To access YouTube Analytics’ REST API from the ElastiCube Manager, you must provide valid Oauth YouTube Analytics credentials through a connection string. These credentials are provided by YouTube Analytics when you create an application.
After you receive your credentials from YouTube Analytics, you can create the connection string and provide Sisense with it to connect to your data.
Creating an App
You can follow the procedure below to register an app and obtain the OAuth client credentials, the Client Id and Client Secret:
- Log in to the Google API Console.
- Select a project or create a new one.
- In the API Manager menu, click Credentials > Create Credentials > OAuth Client Id > Other.
- Click Create. The OAuthClientId and OAuthClientSecret are displayed.
- Click Library > YouTube Analytics API > Enable API.
Authenticating through YouTube Analytics
After setting the following properties, you are ready to connect:
- OAuthClientId: Set this to the Client Id in your app settings.
- OAuthClientSecret: Set this to the Client Secret in your app settings.
- ChannelId: Set this to the YouTube Analytics Channel (Profile). This can be set to the Id of the channel. If not specified, MINE will be used.
- ContentOwnerId: Set this to the Id of the content owner.
- CallbackURL: Set this to http://localhost.
When you connect the driver opens the OAuth endpoint in your default browser. Log in and grant permissions to the application. The driver completes the OAuth process.
Sisense uses connection strings to connect to YouTube Analytics and import data into the ElastiCube Manager.
The connection string to connect to YouTube Analytics has the following structure:
Below is an example of a connection string:
Note: To switch between accounts, you need to delete the file OAuthsettings.txt file located at …\Users\xxx\AppData\Roaming\CData\Youtube Analytics Data Provider.
To add YouTube Analytics data:
- In ElastiCube Manager, click Add Data and then, YouTube Analytics. The Connect to YouTube Analytics window is displayed.
- In Datasource Connection String, enter your connection string.
- Click Connect to Server. YouTube Analytics is displayed in the Select Database list.
- Click OK. Sisense connects to YouTube Analytics and displays a list of tables available for you to import.
- Select the relevant tables and click Add.
The tables are displayed in the ElastiCube Manager.
Switching between Accounts
When you connect to the YouTube Analytics data source, Sisense saves your OAuth values in the file OAuthsettings.txt file located at …\Users\xxx\AppData\Roaming\CData\YouTube Analytics Data Provider on your Sisense server. To connect to the YouTube Analytics data source with another user on the same machine, you must delete the OAuthsettings.txt file. Sisense will then generate a new file for that user.
Another option to support multiple users is to define the location and file name of an OAuthsettings file for each unique user in your connection string through the OAuthSettingsLocation parameter. When each user connects to the data source, Sisense generates the OAuth file with the file name you specify in the location you define. In the examples below, two users are allowed to access the YouTube Analytics data source and for each user, Sisense generates a file that contains that user’s OAuth values in the location defined in the string.
In the example above, to OAuth files are created, one for John and one for Sally in the location C:\YouTube Analytics\auth\.
This is useful if you support many users who each need to access the YouTube Analytics data source.
The Sisense YouTube Analytics connector allows you to import the following tables into the ElastiCube Manager.
|GroupItems||Create, delete, and query Items that compose a Group.|
|Groups||Create, update, delete, and query YouTube Analytics Groups.|
|AdPerformanceReports||Query Ad Performance Reports. Ad Performance Reports provide impression-based metrics for ads that ran during video playbacks. These metrics account for each ad impression, and each video playback can yield multiple impressions.|
|Demographics||Query YouTubeAnalytics Demographics grouped by age groups and gender.|
|Devices||Query YouTubeAnalytics Devices or Operating System statistics. This table allows you to aggregate viewing statistics based on the manner in which viewers reached your video content. For example, you can identify the number of views that occurred on mobile devices or game consoles.|
|EngagementReports||Query Engagement Reports info. For example, how many times a user shared a video.|
|TimeBasedReports||Query time-based info on views, subscribers, etc. For example, how many new subscribers were gained at a specific time.|
|TopVideos||Query the TopVideos for a channel or the TopPlaylists if you are a content owner. You can also use this view to query playback detail and geographic filters.|
|TrafficSources||Query TrafficSources. Statistics are based on the manner in which viewers reached your video and playlist content.|
Hey! Was this article helpful?
Questions? Ask the community.