Custom Google Analytics connector for Power BI and Excel (Power Query)
Clone or download
Latest commit 8c5a92b Mar 12, 2018

README.md

PQGoogleAnalytics - Google Analytics connector for Power BI and Power Query for Excel

This program is written on M# language and it is used for retrieving data from Google Analytics api directly to Power BI Excel using Power Query Addon.

A lot of code [in this application] is taken from article on kohera.be.

You can download Xls and PBIX file from here

Quick setup guide

  1. Open the settings of Power BI, go to "Privacy" tab, choose the setting "Always ignore the Privacy Level settings".

  2. Open the link below in your browser, hit "Allow" button and copy the given token.

https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/analytics.readonly&response_type=code&access_type=offline&redirect_uri=urn:ietf:wg:oauth:2.0:oob&approval_prompt=force&client_id=155297956885-088obc06926s8kolll6kdqkd9u842n56

  1. Open Power Query by hitting "Edit Queries" button on "Home" tab on the ribbon of Power BI.

  2. Paste the token from the step 1 into "authToken" parameter.

  3. Go to "getRefreshToken" query and Copy the token from your preview window.

  4. Paste the token from the step 5 into "refreshToken" parameter.

  5. Your Power BI is ready to get a data from Google Analytics.

Requirements

  1. MS Excel 2010, 2013, 2016 or Power BI
  2. Power Query Addon

Ignore privacy levels

To make this file work you need to enable the setting "ignore privacy levels" on privacy tab in Power BI or Power Query for Excel settings. Here is the screenshot:

Video demonstration

Here is the short video which describes how this workbook works.

https://vimeo.com/maximuvarov/googleanalyticsviapowerqueryformsexcel