Forum Discussion

danxshap's avatar
danxshap
Icon for Helper I rankHelper I
5 years ago
Solved

Google Analytics goal completions data inconsistency

Hi all, I've done some research and am aware of a couple known issues with using Google Analytics & Power BI: The Google Analytics API will sample data for high volume sites, and so the results fo...
  • danxshap's avatar
    danxshap
    5 years ago

    Hi Jimmy801 thank you very much for the reply!

     

    I contacted Power BI support about this and their response, combined with yours, explains what's going on.

     

    The TLDR solution is:

    1. Get your request working in the Google Analytics Query Explorer with the appropriate date range filters and make sure it says the data is not sampled.
    2. Apply the same date range filters via a Power Query filter step, and the data should match the query explorer.

    For anyone else who runs into this problem, the issue has to do with date range filtering (or lack thereof) with the Google Analytics API. By default, Power BI doesn't pass any date filtering parameters when it makes the API request, and that's what results in inconsistent data — in my testing, it can actually be sampled data even when you're not working with big numbers, I guess because it's asking Google Analytics to return data for potentially years worth of data without any date filtering.

     

    The key is to add a filter step in Power Query that limits the date range, which somehow makes its way into the resulting API request (I guess through the MDX that you mentioned, which is a concept I was not familiar with).

     

    I also found it very useful to try the same request in the Google Analytics Query Explorer to see how different filtering parameters (often larger date ranges) result in the tool telling you whether the returned data is sampled or not.