Search code examples
google-analyticsgoogle-analytics-apigoogle-analytics-firebase

GA API - Confirmation to get full day of data


Im using GA API to get transactions data and I want to ask, when is the best time to get full day of data? Our schedule is set on 4:00AM next day. Is it enough to get data from yesterday? What is the delay with real data process?

Is there any way to check if data is correct, so from the full day? What is the best practice for that? Wait for the next day and download all data from yesterday? Or download data every hour? Should we also update previous data somehow or I can be sure that when I download data from specific hour it will be always correct and updated?

Thanks!


Solution

  • API response for stable processed data has a parameter isDataGolden. You can find it in [API docs].1

    Indicates if response to this request is golden or not. Data is golden when the exact same request will not produce any new results if asked at a later point in time.

    Note that 1) it could take more than 24h for data to become golden 2) API do not tells you isDataGolden:false and ignores this parameter for not finalized data.

    I suppose that you can make recurring request for your yesterday data and overwrite them each time as soon as they are not 'golden'