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
cosminc
Post Partisan
Post Partisan

Google analytics API issue

Hi all,

 

i have a challenge these days with API form Google analytics (which worked fine till now)

 

in power query if i filter a day (12/03/2021) tha value for Goal 10 = 1 is correct, same with Google Platform

base 1.jpg

 

without date filter (and how i need the entire base which is the source for visuals), the result is 12 and is wrong.base 2.jpg

 

 

any suggestion how to make it to work ok?

 

Thanks,

Cosmin

6 REPLIES 6
QueryWhiz
Helper V
Helper V

Hi @cosminc Seems like an issue with your connector. As a workaround, maybe you can try to test your connection with a 3rd party tool. I've tried windsor.ai, supemetrics and funnel.io. I stayed with windsor because it is much cheaper so just to let you know other options. They have a free tier also so you can test and see if you still get that data mismatch or not. In case you wonder, to make the connection first search for the GA4 connector in the data sources list:

 

GA4-1.png

 

After that, just grant access to your GA4 account using your credentials, then on preview and destination page you will see a preview of your G4 fields:

 

GA-2.png

 

There just select the fields you need. Finally, just select PBI as your data destination and finally just copy and paste the url on PBI --> Get Data --> Web --> Paste the url. 

 

SELECT_DESTINATION_NEW.png

cosminc
Post Partisan
Post Partisan

when i reduce the data base with filters in Query editor is ok, when is full is not ok

is it possible to be a power bi bug? if i reduce data only since 1 jan 2021 to work fine?

thanks

Cosmin

 

Hi @cosminc ,

 

What's your Power BI Desktop version? Please use the latest version of power Bi desktop.

And do you mind providing the M code of this table?

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

same problem with the new power bi version

so the cube results are changing depending on date filter which reduces the base size.

it seems to be a connector bug

 

thanks

Cosmin

Hi 

 

i'll check the problem again after the update with the last version, but this is not ok, the solution must be fine with any versions; 

 

the syntax (with anonimous codes):

 

let
Source = GoogleAnalytics.Accounts(),
#"12345678" = Source{[Id="11390697"]}[Data],
#"UA-87654321-1" = #"87654321"{[Id="UA-87654321-1"]}[Data],
#"23029405" = #"UA-11390697-1"{[Id="12345678"]}[Data],
#"Added Items" = Cube.Transform(#"12345678",
{
{Cube.AddAndExpandDimensionColumn, "ga:date", {"ga:date"}, {"Date"}},
{Cube.AddAndExpandDimensionColumn, "ga:adContent", {"ga:adContent"}, {"Ad Content"}},
{Cube.AddAndExpandDimensionColumn, "ga:adGroup", {"ga:adGroup"}, {"Google Ads: Ad Group"}},
{Cube.AddAndExpandDimensionColumn, "ga:campaign", {"ga:campaign"}, {"Campaign"}},
{Cube.AddMeasureColumn, "Goal 10 Completions", "ga:goal10Completions"},
{Cube.AddMeasureColumn, "Goal 11 Completions", "ga:goal11Completions"},
{Cube.AddMeasureColumn, "Goal 12 Completions", "ga:goal12Completions"},
{Cube.AddMeasureColumn, "Goal 15 Completions", "ga:goal15Completions"},
{Cube.AddMeasureColumn, "Goal 16 Completions", "ga:goal16Completions"},
{Cube.AddMeasureColumn, "Goal 5 Completions", "ga:goal5Completions"},
{Cube.AddMeasureColumn, "Goal 6 Completions", "ga:goal6Completions"},
{Cube.AddMeasureColumn, "Goal 7 Completions", "ga:goal7Completions"},
{Cube.AddMeasureColumn, "Goal 8 Completions", "ga:goal8Completions"},
{Cube.AddMeasureColumn, "Goal 9 Completions", "ga:goal9Completions"}
}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Added Items", {"Campaign", "Ad Content", "Google Ads: Ad Group", "Date"}, "Attribute", "Value"),

 

thanks,

Cosmin

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