Forum Discussion
intrasight
10 years agoHelper IV
Google Analytics connector missing startdate/enddate parameters
I thought this had been asked before, but I didn't find a thread via search. A GA connection has a query pattern like so: let
Source = GoogleAnalytics.Accounts(),
account = Source{[Id="6...
artemmuntianu
8 years agoFrequent Visitor
Our solution to un-sampling is to break a month/year query to many daily queries, and aggregate the data later on the client-side.
Here is a code
let
Source = GoogleAnalytics.Accounts(),
#"1" = Source{[Id="999"]}[Data],
#"2" = #"1"{[Id="999"]}[Data],
#"3" = #"2"{[Id="999"]}[Data],
#"newCube" = Cube.Transform(#"3",
{
{Cube.AddAndExpandDimensionColumn, "ga:date", {"ga:date"}, {"Date"}},
{Cube.AddAndExpandDimensionColumn, "ga:deviceCategory", {"ga:deviceCategory"}, {"Device Category"}},
{Cube.AddAndExpandDimensionColumn, "ga:userAgeBracket", {"ga:userAgeBracket"}, {"Age"}},
{Cube.AddMeasureColumn, "Sessions", "ga:sessions"}
}),
combinedData = Table.Combine({
Table.SelectRows(#"newCube", each ([Date] = #date(2017, 1, 1))),
Table.SelectRows(#"newCube", each ([Date] = #date(2017, 1, 2))),
... {days in between} ...
Table.SelectRows(#"newCube", each ([Date] = #date(2018, 3, 4))),
Table.SelectRows(#"newCube", each ([Date] = #date(2018, 3, 5)))
})
in
combinedDataWhen we run that code it makes PowerBI to send 429 GA requests. One request per day.
So, Power BI is actually requests GA with proper startdate and enddate params.
One problem still remains - when you combine data on the client side it becomes a bit inaccurate in terms of unique counters.