This document goes over the process required to create an API connection to Google Analytics. This process will flow from initializing the API connection to creating a job in the ETL tool that transfers that API data into a database table/data source, to adding a chart connecting to that data source.
Please note that before beginning to make your connections, you will need to verify that you have enabled your Google API calls. Google has an extra API layer above Client ID and Secret where the entire API functionality can be enabled or disabled. So once you have your Client key, you must also enable the API. Otherwise, you can browse and navigate your API but no data will be allowed to stream through the connection. To do this, in your Google Analytics dashboard, click on the ENABLE APIS AND SERVICES link.
Now click the ENABLE button to enable your API.
Begin by logging into the iDashboards Data Hub and select the API Accounts option from the System Drop Down menu.
You will now see a new screen that shows you the API Accounts options as well as any existing API connections you might have already configured. Click the Add Account button.
Now select the Google Analytics option and click Login.
Open a browser and browse to https://console.developers.google.com/
Select Credentials from the left hand navigation
Open the Create credentials dropdown and choose OAuth client ID
Under Application type choose Web Application
Use the following Settings:
- Name - "iDashboards Data Hub" (or other descriptive name)
- Authorized redirect URIs - Use the "Redirect URL" value from the Add Account dialog in the iDashboards Data Hub
A dialog will open with the Client ID and Client Secret copy and paste those values into the appropriated field in the Add Account dialog in the iDashboards Data Hub
Choose your account in the new window
Click Allow. You will now see the Account Created Successfully window. Close this window and go back to the Data Hub and refresh the page.
You will now see the newly created Google Analytics option available in the Data Hub window.
You have completed adding your Google Analytics API connection. From here you are now ready to proceed to creating a new data set in the ETL tool. First create a new Data Set:
Select Cloud API and choose the Google Analytics option.
In the next window, you can further define what you want to see in the data set. Select your Account, a Web Property, and a View. You can also select a date range and the Column Set. Active Users was selected in this example.
Once you have completed defining your data, click Save. In the new window, you can confirm your data.
Click Save and give the new data set a name and save it to an available Data Sets folder. Click Save again.
Your new Data Set will now be available in the Data Hub and you can access it under Edit Data Sets:
Click Open. Next, create a new ETL job to add the data from the data Set into a database table:
Add a Load operation and link the Extract to the Load. Then configure the Load operation to save the data to a table in your database.
Click Create a Target Table from Input. Select a Schema:
Give the Table a name and click Create:
Verify your details in the next window and click Save.
Now you can begin building out your ETL job. Create a simple job that moves the data from the data set into a database table of your choosing with just an Extract task and Load task. Once that is done, click Save or Save As.
Once the job has been run to create the table and it has added the data to the data store target table you selected, you now have an available data source that contains your QBO data and you are ready to build a chart from this data in the User application.
Log into the User application and right click on any dashboard and select New Chart, then find the data hub data source you added the table to and select it from the list. Now pick the correct data set table you created in the ETL tool and click Next.
Now, select the columns you want to use in your chart and click Next.
Finally, choose a chart type and click Finish.
You will now see your new chart filled with data from your Google Analytics API connection in your new chart.
If you see the following error message when you attempt to run the ETL job, your Google Analytics account has been logged out and you need to login again to be able to run the job and save the data to the table.