8-bit-sheep / googleAnalyticsR

Use the Google Analytics API from R
https://8-bit-sheep.com/googleAnalyticsR/
Other
259 stars 76 forks source link

v3 API MCF reports fetching #410

Closed aleevsergey closed 2 years ago

aleevsergey commented 2 years ago

Hi Mark! Thanks for this project, it is really helpful.

I faced some problems few days ago when one of my clients get bitter amount of data that was expected.

I'm using this for fetching the data for him:

response <- google_analytics_3(
          id = id,
          start = j,
          end = j,
          metrics = metrics_to_get,
          dimensions = dimensions_to_get,
          filters = filter,
          type = "mcf",
          max_results = 10000,
          samplingLevel = "HIGHER_PRECISION"
        )

And now it started to get this type of response from API:

2022-10-19 11:05:04 > Fetched:  sourceMediumPath campaignPath keywordPath adwordsCreativeIDPath adwordsAdGroupPath transactionId timeLagInDaysHistogram totalConversions totalConversi
onValue . [ 10000 ] total results out of a possible [ 40448 ], Start-Index:  1
ℹ️ 2022-10-19 11:05:04 > Batching data into [ 5 ] calls.
ℹ️ 2022-10-19 11:05:04 > Request #:  1 : 10001 : 20001 : 30001 : 40001
ℹ️ 2022-10-19 11:05:26 > Request Status Code:  503
ℹ️ 2022-10-19 11:05:26 > Trying again:  1  of  2
ℹ️ 2022-10-19 11:05:29 > Trying again:  2  of  2
ℹ️ 2022-10-19 11:05:33 > All attempts failed.

I know that it's better to go to v4, but there are no MCF reports. So maybe it can be fixed somehow? Thanks for your help!

MarkEdmondson1234 commented 2 years ago

I'm surprised it's lasted this long, I guess they may have turned it off. Regardless it will be by July 2023 so it's probably not going to be fixed sorry :)

aleevsergey commented 2 years ago

It's still working, but only for max_results <10k. Any way. Thanks!

MarkEdmondson1234 commented 2 years ago

Oh ok yes that is an outstanding issue from a while back that got passed over to fix. The parsing function used in the others isn't used for mcf as it's in a format not easily migrated.