legato icon indicating copy to clipboard operation
legato copied to clipboard

[137] GA API V4

Open tpitale opened this issue 2 years ago • 9 comments

  • [x] Move current request/response to V3 namespace to make space
  • [x] Add new request with to_body version of query
  • [x] Add response handling
  • [x] columnHeader
  • [x] reportRows
  • [ ] dimensionFilterClauses (https://developers.google.com/analytics/devguides/reporting/core/v4/migration#filters)
  • [ ] metricFilterClauses
  • [ ] errorHandling (v3 doesn't do any at this time, but here it is for v4: https://developers.google.com/analytics/devguides/reporting/core/v4/migration#error_handling)
  • [ ] Pagination (https://developers.google.com/analytics/devguides/reporting/core/v4/migration#pagination)
  • [ ] Handle type parsing of metric response (https://developers.google.com/analytics/devguides/reporting/core/v4/migration#column_header)
  • [ ] Test it against V4 API

resolves #137

tpitale avatar Apr 28 '22 00:04 tpitale

@tpitale this is a great library. Thank you for your work on it.

It looks like a pretty good effort to get GA4 going and that effort is one that's becoming pretty urgent with GA4 on the horizon. It's not clear to me if the todo list on this PR is accurate based on the amount of code I see. Do you have a clear sense of what work is left?

Do you think Legato will end up supporting GA4 soonish? Is there something a fairly senior Ruby dev, or the community as a whole could do to help get this done?

orangewolf avatar May 09 '23 19:05 orangewolf

The library does not support all the functions of the previous version so far. That's what all the TODOs are for.

It should be ready for someone with a V4 capable account to test some basic metrics/dimensions queries. If the basics work, I'm happy to merge this and start more focused work on the other features.

I hope it will support V4, but I'm not working at a company which uses GA (and haven't for years).

I'm also open to anyone taking this branch and trying to get more features added.

tpitale avatar May 09 '23 20:05 tpitale

Nope … I'm conflating this with V4 work on Staccato. I haven't looked at this in a long time.

It's a shame, but I'm just not doing ruby much either. I've got a young kid and very little free time. It happens.

tpitale avatar May 09 '23 20:05 tpitale

Don't give up. I'm actually in a meeting about Staccato/Legato. We use it as part of Hyrax for an academic archive, so I'm not sure how we could help with testing more than page views, but we can try. Is the readme on this branch updated for G4?

KennaW avatar May 09 '23 20:05 KennaW

@tpitale I think there is a good chance that the Hyrax community (which uses this gem and has a lot of energy about getting a G4 update done) can take this branch and move it forward as long as you are ok with that / would be willing to potentially merge / release. I 100% understand the young kid thing and moving on professionally. Are you open to the idea of additional maintainers?

also, thank you for replying so quickly =-) I know that even that can be hard to make time for sometimes

orangewolf avatar May 09 '23 22:05 orangewolf

Thanks everyone. I'm happy to take on more maintainers. If you wouldn't mind, let me try to take a run at it again this weekend.

Catch up again on Monday?

tpitale avatar May 10 '23 02:05 tpitale

Looking over this again, I have a local version of the branch where I've made progress handling the response. I think I just need to map the dimension/metrics to the rows (https://developers.google.com/analytics/devguides/reporting/core/v4/migration#rows) and then very basic testing can begin.

After that, I think the only other part that NEEDS to happen is handling the filtering, which I think is a critical part of functionality. Maybe I'm wrong about that?

tpitale avatar May 10 '23 02:05 tpitale

filtering is pretty critical for the Hyrax use case.

orangewolf avatar May 11 '23 23:05 orangewolf

If it helps in anything... I did a small api wrapper that includes filtering too:

https://github.com/dailytics/google_analytics_v4_api

luctus avatar May 12 '23 15:05 luctus