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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
edwardrmiles
Helper III
Helper III

Using Google Analytics Customs Segment

I'm using the Google Analytics (GA) connector in Power BI desktop.  I want to filter my queries using custom segments. I've created these segments in GA but I can't work out how to add them to my query.

 

They don't appear in the 'Add Items' menu but they are documented in the Googla Analytics Core Reporting API (which I presume Power Query is using) https://developers.google.com/analytics/devguides/reporting/core/v3/segments

 

 

 

 

 

 

1 ACCEPTED SOLUTION
edwardrmiles
Helper III
Helper III

It doesn't appear possible to use Segments with the off the shelf GA connector.  Using Web.Contents() to query the Core Reporting API doesn't work either as GA requires OAuth2 authentication and the PQ doesn't support that.

 

I solved the problem by writing a Python script, however I', told the new Data Connector SDK allows OAuth2 authentication (https://powerbi.microsoft.com/en-us/blog/data-connectors-developer-preview/) so that might be worth a try

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

You can vote for custom segments to be added to the Google Analytics data connector here

@Anonymous @edwardrmiles @v-chuncz-msft 

Another - more stabil - solution is to get access to the unaggregated Google Analytics data.

This is possible using the scitylana.com services.

Try it here

 

edwardrmiles
Helper III
Helper III

It doesn't appear possible to use Segments with the off the shelf GA connector.  Using Web.Contents() to query the Core Reporting API doesn't work either as GA requires OAuth2 authentication and the PQ doesn't support that.

 

I solved the problem by writing a Python script, however I', told the new Data Connector SDK allows OAuth2 authentication (https://powerbi.microsoft.com/en-us/blog/data-connectors-developer-preview/) so that might be worth a try

Anonymous
Not applicable

Hi Edward,

 

Could you please share your Python script you used for getting GA Segments ?

 

Thank you for your help.

 

Nicolas.

Anonymous
Not applicable

Hi Edward,

 

Could you please share your Python script you used for getting GA Segments ?

 

Thank you for your help.

 

Nicolas.

v-chuncz-msft
Community Support
Community Support

@edwardrmiles,

 

I'm not familiar with it, but you may do research into the Advanced Editor.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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