-
Notifications
You must be signed in to change notification settings - Fork 291
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
Add new resolver to the conversion reporting datastore partial to retrieve detected and lost events from inline module data #9379
Comments
AC ✔️ |
@zutigrm IB ✅ , moving to EB. |
Assigning this to myself to get this moved through and unblock other issues 🙂 |
QA Update ⚠Going through the QAB, I have a couple of things to highlight: ITEM 1:
ITEM 2:
ITEM 3:
Other than that .getConversionReportingEventsChange() worked well:
|
@kelvinballoo Thanks for you observations. Sorry about that, I update QAB now, we changed in the last CR round, what you see is correct output, |
QA Update ✅Thanks @zutigrm , going through the new QAB, everything is checking out.
|
Feature Description
Conversion reporting datastore partial should be updated to include new resolver which would retrieve detected and lost events from inline module data (implemented in #9342), and pass them to an action which should receive passed data and store them to the state.
See Implementation - Datastore Partial section of the design doc
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
getConversionReportingEventsChange
is added to theconversion-reporting
datastore partialConversion_Reporting_Events_Sync
to Store detected and lost events #9342receiveConversionReportingInlineData
actionreceiveConversionReportingInlineData
is implemented, which yields passed object to the reducerdetectedEventsChange
propertyhasNewConversionReportingEvents
andhasLostConversionReportingEvents
are addeddetectedEventsChange
state property by usinggetConversionReportingEventsChange
selectorImplementation Brief
assets/js/modules/analytics-4/datastore/conversion-reporting.js
detectedEventsChange
,undefined
by defaultgetConversionReportingEventsChange
resolvernewEvents
andlostEvents
from Analytics inline module data likeglobal._googlesitekitModulesData?.[ 'analytics-4' ]?.newEvents
, etc.receiveConversionReportingInlineData
actionassets/js/googlesitekit/datastore/site/info.js
, or any other datastore partial resolving inline data.receiveConversionReportingInlineData
actionnewEvents
andlostEvents
from the passed argument, and yield them as an object to the reducer. Then in the reducer, updatedetectedEventsChange
object in the state to holdnewEvents
andlostEvents
as propertiesgetConversionReportingEventsChange
selectorstate.detectedEventsChange
hasNewConversionReportingEvents
andhasLostConversionReportingEvents
selectorsgetConversionReportingEventsChange
selector to retrieve the inline data (or resolve it if not yet available), and then extract their respective properties from the returned value. You can add a helper function to extract the correct property, like for example, how it is used ininfo
datastoresite-kit-wp/assets/js/googlesitekit/datastore/site/info.js
Lines 38 to 43 in d0f81d3
newEvents
orlostEvents
for the argumentTest Coverage
assets/js/modules/analytics-4/datastore/conversion-reporting.test.js
to include test coverage for new resolver, action and selectorsQA Brief
conversionReporting
feature flag enabledawait googlesitekit.data.select('modules/analytics-4').getConversionReportingEventsChange()
undefined
{newEvents: Array(0), lostEvents: Array(0)}
undefined
for bothnewEvents
andlostEvents
await googlesitekit.data.select('modules/analytics-4').hasNewConversionReportingEvents()
undefined
, afterwards should showfalse
undefined
valueawait googlesitekit.data.select('modules/analytics-4').hasLostConversionReportingEvents()
await googlesitekit.data.select('modules/analytics-4').hasNewConversionReportingEvents()
aboveawait googlesitekit.data.dispatch('modules/analytics-4').receiveConversionReportingInlineData({newEvents: ['contact'], lostEvents: ['purchase']})
await googlesitekit.data.select('modules/analytics-4').getConversionReportingEventsChange()
should return whole object passed above:{lostEvents: ['purchase'], newEvents: ['contact']}
await googlesitekit.data.select('modules/analytics-4').hasNewConversionReportingEvents()
should returntrue
await googlesitekit.data.select('modules/analytics-4').hasLostConversionReportingEvents()
should returntrue
Changelog entry
The text was updated successfully, but these errors were encountered: