Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Lino
Frequent Visitor

Google Analytics Complete Connector

Dear Community

 

I am looking for a complete way to extract data from Google Analytics using Power BI.

 

The must-have points are the following:

 

  1. Setting of parameters like View ID, Start Date, End Date, Metrics, Dimensions, Sort, Filter and Max Results.
  2. Schedule refreshing of data in Power BI Service.

 

I created a Custom Connector that works in Power BI Desktop, but unfortunately I cannot use it in Power BI Service. Pratically, using this Custom Connector, the dataset of the report cannot be refreshed in Power BI Service, because it is not recognized.

 

Does someone know a way to do that?

 

Regards

Lino

6 REPLIES 6
v-shex-msft
Community Support
Community Support

HI @Lino,

 

Why you not use official method to export google analytics data?  For power bi connectors, it may not similar as the original one.(it may contains some modifies or other operations to improve compatibility)

 

In addition, you can also try to use odata connector to connect to google analysis API.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hello v-shex-msft

 

Thanks for your reply.

 

The official method could be a solution by creating an ETL process behind, but I am trying to exctract directly data using Power BI.

 

Using M Language, my scope would be:

 

  1. Getting Authorization Code using https://accounts.google.com/o/oauth2/v2/auth.
  2. Using Authorization Code, getting Token using https://accounts.google.com/o/oauth2/token.
  3. Using Token, getting data from Google Analytics using Analytics API.

 

It works creating a Custom Connector via Visual Studio, but it does not work in Power BI Service, since I cannot use custom connectors there. Therefore, I am trying to create the same logic using M language directly in Power BI Desktop.

 

My first issue is getting Authorization Code using Web.Contents function. This function returns the correct page that includes the Code parameter as response inside of the URL.

 

Now, how can I get a parameter inside of an URL using M language?

 

Regards

Lino

HI @Lino,

 

You can take a look at below link:

authenticating with Excel Power Query against .Net Odata Web Api

 

BTW, current custom power query functions only available on desktop side.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @v-shex-msft

 

Thanks a lot for your suggestion, but I used GoogleAnalytics.Accounts() built-in function and everything is working with both the Desktop and the Service version.

 

Unfortunately, I cannot set filters before the extractions, but at the moment I am not encountering issues.

 

Regards

Lino

Lino
Frequent Visitor

I want to rectify. Unfortunately, the built-in Google Analytics connector does not work correctly, and therefore I opened this discussion.

Roel
Frequent Visitor

It works correctly, but it's requesting all data ever from the GA API.

As a result GA sampling is destroying your data. This in turn makes the connecter useless for anything except the most basic things. (like all visits of a period of time)

 

They really need to change the way the connecter works so you can specify the data range, but more importantly, like all other tools for GA, allow you to break up the query in smaller sections.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors