Skip to content
Switch branches/tags
Go to file

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

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.

  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.


  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.