Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revised run_analytics_report API design #8908

Closed
Cassandra-Clark opened this issue Jan 30, 2024 · 3 comments · Fixed by #9239
Closed

Revised run_analytics_report API design #8908

Cassandra-Clark opened this issue Jan 30, 2024 · 3 comments · Fixed by #9239
Assignees
Labels
-libs Libraries: New libraries to be implemented

Comments

@Cassandra-Clark
Copy link
Contributor

Cassandra-Clark commented Jan 30, 2024

The Google Analytics APIs offer a robust and varied set of options for querying data. The current run_analytics_report method only supports modification to which property is being queried and the date range, but there is room for a much more robust set of options.

A rough outline of the proposed API follows:

run_analytics_report File -> Text -> Date -> Date -> Metrics -> Dimensions -> Table
run_analytics_report authentication_file=Nothing start_date:Date=(Date.new 2020 3 31) end_date:Date=date.today metrics:[see notes] dimensions:[see notes]

authentication_file

Default is Nothing, if default then uses the GOOGLE_APPLICATION_CREDENTIALS environment variable. If a secrets file is provided, uses that file instead. There are two different options that can be used for this, options.credentials which is a JSON object and options.keyFilename which is a path. Ideally both of these would be supported, but the credentials option is probably more Enso-y if we have to pick one. See this documentation from Google for more details

NOTE: As the secrets file can allow access to powerful modifications within the user's google_analytics space, it should probably be treated similarly to a password. This could leverage enso's support of secrets instead as a more robust design.

Metrics
a helper with a list of supported metrics from the reporting api, IE activeUsers
Supports a vector of a sequence of metrics and iterates through .addMetrics to add each one.

Dimensions
a helper with a list of supported dimensions from the reporting api, IE city
Supports a vector of a sequence of metrics and iterates through .addDimensions to add each one.

reference document for all dimensions and metrics. We can discuss which ones are high priority as I don't think we have to support all of them, and there are some metric+dimension pairs that do not work

@Cassandra-Clark Cassandra-Clark added the -libs Libraries: New libraries to be implemented label Jan 30, 2024
@jdunkerley jdunkerley changed the title revised run_google_report API design Revised run_google_report API design Feb 1, 2024
@Cassandra-Clark Cassandra-Clark removed their assignment Feb 1, 2024
@Cassandra-Clark Cassandra-Clark changed the title Revised run_google_report API design Revised run_analytics_report API design Feb 5, 2024
@jdunkerley jdunkerley moved this from ❓New to 📤 Backlog in Issues Board Feb 6, 2024
@enso-bot
Copy link

enso-bot bot commented Feb 7, 2024

Cassandra Clark reports a new STANDUP for today (2024-02-06):

Progress: run_analytics_report design, book club, table.running design It should be finished by 2024-02-15.

Next Day: review run_analytics_report and table.running, publish book club

@AdRiley AdRiley moved this from 📤 Backlog to 🔧 Implementation in Issues Board Feb 20, 2024
@Cassandra-Clark
Copy link
Contributor Author

For Dimensions and Metrics, the following should be used to start:

Dimensions:

  1. userType
  2. sessionCount
  3. daysSinceLastSession
  4. userBucket
  5. sessionDurationBucket

Metrics:

  1. users
  2. newUsers
  3. percentNewSessions
  4. sessionsPerUser
  5. bounces
  6. bounceRate
  7. hits

@AdRiley
Copy link
Member

AdRiley commented Feb 23, 2024

Are we supporting UA or GA4? Those are all UA options, but think we want to be on GA4 right?

@AdRiley AdRiley moved this from 🔧 Implementation to 👁️ Code review in Issues Board Mar 12, 2024
@AdRiley AdRiley moved this from 👁️ Code review to 🟢 Accepted in Issues Board Mar 19, 2024
@AdRiley AdRiley linked a pull request Mar 19, 2024 that will close this issue
5 tasks
@AdRiley AdRiley closed this as completed Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-libs Libraries: New libraries to be implemented
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants