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

Creation of a New GA4 Datastore Partial for Detected ACR Events #9132

Closed
6 tasks
10upsimon opened this issue Aug 5, 2024 · 7 comments
Closed
6 tasks

Creation of a New GA4 Datastore Partial for Detected ACR Events #9132

10upsimon opened this issue Aug 5, 2024 · 7 comments
Labels
javascript Pull requests that update Javascript code Module: Analytics Google Analytics module related issues P0 High priority Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature

Comments

@10upsimon
Copy link
Collaborator

10upsimon commented Aug 5, 2024

Feature Description

As part of the ongoing Analytics Conversion Report work, notably issues #9130 and #9131, there is a need to surface said new ACR events data via a new Google Analytics 4 datastore partial. This new datastore will be responsible for resolving the new inline module data added to the GA4 module in #9131, and it will function similarly to how we handle retrieval of custom dimensions within the GA4 module, etc.

This datastore should contain the necessary resolver, action and and selectors in order to retrieve the detected ACR events within the users GA4 report data.

See the relevant section of the design document for more detailed information.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The inline Analytics 4 data from _googlesitekitModulesData holding the available event names under recentEvents key is retrieved and stored in the MODULES_ANALYTICS_4 datastore.
  • New datastore partial should be created, with following:
    • Selector for returning the detectedEvents value
    • Resolver for retrieving the data if unavailable and updating the state through action
    • Action which receives the data and passes it to the reducer
    • Selector which will check if the stored detectedEvents value has any of the event names passed as the parameter

See #9132 (comment) regarding edits

Implementation Brief

  • Add assets/js/modules/analytics-4/datastore/conversion-reporting.js
    • include recentEvents to the initial state object
    • Add getConversionReportingEvents resolver
      • Return early if analytics module is not connected or _googlesitekitModulesData is not set
      • Retrieve events from _googlesitekitModulesData['analytics-4']['recentEvents'] and pass them to the receiveConversionReportingEvents action
    • Add getConversionReportingEvents selector to return the recentEvents from the state
    • Add receiveConversionReportingEvents action
      • It should accept events prop and yield it to the reducer
    • Add hasConversionReportingEvents selector
      • It should accept events prop
      • Retrieve stored events with getConversionReportingEvents selector and check for the presence of events within the returned array if not empty
      • It should return boolean value to represent if passed events are present or not

Test Coverage

  • Add test coverage for new datastore partial

QA Brief

  • No QA needed here as there are no new features/changes.

Changelog entry

  • Add support for Analytics Conversion Report Events in data store.
@10upsimon 10upsimon added javascript Pull requests that update Javascript code Module: Analytics Google Analytics module related issues Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature labels Aug 5, 2024
@zutigrm zutigrm self-assigned this Aug 16, 2024
@zutigrm zutigrm removed their assignment Aug 16, 2024
@binnieshah binnieshah added the P0 High priority label Aug 19, 2024
@eugene-manuilov eugene-manuilov self-assigned this Aug 19, 2024
@eugene-manuilov
Copy link
Collaborator

  • Relevant selector/resolver should be created to obtain the stored values in new datastore partial

@zutigrm, let's define which selectors and actions should be created to make it clear. No need to put selector and action names there, but just explain what they should do. For example:

  • A new selector to return Foo from the state.
  • A new action that accepts Bar and update Baz in the stat
  • ...

@zutigrm
Copy link
Collaborator

zutigrm commented Aug 20, 2024

@eugene-manuilov thanks, AC updated

@zutigrm zutigrm assigned eugene-manuilov and unassigned zutigrm Aug 20, 2024
@eugene-manuilov
Copy link
Collaborator

Awesome! Thanks, @zutigrm. Slightly updated AC to have two top level points. AC is ✔️ now.

@eugene-manuilov eugene-manuilov removed their assignment Aug 21, 2024
@zutigrm zutigrm assigned zutigrm and unassigned zutigrm Aug 22, 2024
@10upsimon 10upsimon self-assigned this Aug 22, 2024
@10upsimon
Copy link
Collaborator Author

@zutigrm IB LGTM, moving to EB

@aaemnnosttv
Copy link
Collaborator

@zutigrm @10upsimon it seems to me some of the work here isn't necessary unless I'm misunderstanding? See my comment on the doc.

@aaemnnosttv aaemnnosttv mentioned this issue Aug 27, 2024
18 tasks
@zutigrm
Copy link
Collaborator

zutigrm commented Aug 28, 2024

@aaemnnosttv Actually you are correct, since we switched to storing events in the settings, we will only need hasConversionReportingEvents selector, as helper that will be used with widgets

@tofumatt
Copy link
Collaborator

Moving directly to Approval as there's nothing to QA here 🙂

@tofumatt tofumatt removed their assignment Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code Module: Analytics Google Analytics module related issues P0 High priority Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

6 participants