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
Implement the happy path for creating audiences and the custom dimension via the Setup CTA Banner #8131
Comments
@techanvil Just wanted to check if this issue deals with adding the fetched User Audiences or the newly created Site Kit audiences to the list of |
@sigal-teller @marrrmarrr Since this issue is adding the new Success Notice component, I wanted to flag this as another component that is similar in looks to our existing SettingsNotice components (also used in other places on the dashboard like here) and similar in behaviour to our Setup Success Banner Notifications. However, our decision here is summarised by Sigal's comment in slack where we intend to create this new component for now and reuse it in other places in the Site Kit plugin where applicable in the future. |
@jimmymadon The new success notification I designed for Audience segmentation is intended to replace all successful setup notifications. We would like to keep consistent but I assume we’ll implement it gradually. This one should be replacing the large white banner that we have now. The other one you mentioned (the yellow one) is a warning notification and should be used for other purposes. I updated its design as well in recent designs. |
Hi @jimmymadon - yes, this issue should deal with setting |
@bethanylang Should we create a separate issue to convert all the Setup Success banner components? This would be a super low P5 for now 😄 |
@marrrmarrr @sigal-teller I had two small comments on the copy of the Setup Success Notice:
|
@jimmymadon good catch, we can definitely update this a bit. |
@jimmymadon Thanks for catching that. @marrrmarrr I think it's a bit too long for success notification text. we need to keep in mind that the user has just seen the CTA banner, we don't need to repeat the messages. The success notification purpose should mainly informing the user that the setup was successful and what are the next steps - there's a new section where he can see this data and we can point him there with "shoe me". |
Hi @jimmymadon, this AC is almost there, however, and with apologies for the moving target, the design doc has or may change a bit in a couple of relevant areas, which means the AC will need an update, but it will need to wait until these changes are finalised. The current AC is slightly off with regard to what is now the old setup logic because it focuses on checking user-created audiences, thus missing the edge case where the new/returning visitors audiences are already created and should be considered for inclusion in the initial audience selection, plus the potential to include the "Purchasers" audience if it's "active". However, this focus on the user-created audiences has made me realise that we should update the setup logic to raise the priority of user-created audiences for inclusion. As a result, I've proposed a refinement to the setup logic in the design doc. This needs to be approved by Mariya and Evan, who I've tagged on a comment thread. Beyond this, there are a couple of points with regard to the audience configuration:
Lastly, we might want to hold off until the copy for the Setup Success Notice has been updated in Figma before moving this to IB (or, leave a note in the AC or IB section to bring attention to the fact that it's liable to change). |
Hi @techanvil @jimmymadon just to note for the Found this out while working on #8108 . I added suggestion in design doc as well
|
Thanks for the spot(s) @zutigrm! I've accepted your suggested changes in the design doc, and tweaked it a little further. |
@jimmymadon I'm moving this to the Backlog to help clarify which issues still need to be finalised in the design doc. |
@jimmymadon regarding the UI copy, let's shorten it like this: |
@jimmymadon, just a heads up that I have made this issue dependent on #8238 as we can reuse the component introduced there for the success banner (I also added a note about this in the Feature Description). |
Unassigning myself due to my break. c.c. @ivonac4 @bethanylang @techanvil |
The design doc has progressed to a point where this is now unblocked, so I've moved it out of the Backlog and will continue working on the AC myself. |
Hi @kuasha420, thanks for drafting this IB. A few points:
|
@techanvil Thank you for the review. I've amended my IB to incorporate your feedback and bumped up the estimate. The In Progress state for the spinner button is already implemented, in the component, did you mean the button should say Cheers. |
Thanks @kuasha420! Thanks for clarifying re. the in progress state. The copy I think this just needs the Test Coverage section to be added and it should be GTG. |
IB LGTM, thanks @kuasha420! ✅ |
Feature Description
Add the Setup CTA Banner to the dashboard, implement the happy path setup logic, and show the success state.
Note that this issue does not include redirecting to OAuth if necessary, this will be implemented separately via #8132.
Additionally, the success state can reuse the component introduced in #8238.
See setup CTA banner in the design doc.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
configuredAudiences
, ordered by user count over the past 90 days, to a maximum selection of two audiences.configuredAudiences
, to a total maximum selection of two audiences.configuredAudiences
.googlesitekit_post_type
custom dimension is already created for the property, and if not, then create this custom dimension as per the definition already in the plugin:Implementation Brief
In
includes/Modules/Analytics_4/Audience_Settings.php
configuredAudiences
tonull
.The
isPropertyPartialData
andisAudiencePartialData
selectors implemented in Add “partial data” states infrastructure #8141 determines whether the property has been in partial data state for the currently selected date range. This cannot be used directly here, as we need to know this for the "last-90-days".isResourcePartialData
the following alteration.startDate
fromgetDateRangeDates
, get thereferenceDate
usinggetReferenceData
selector, and calculate the start date usinggetPreviousDate
function, with91
days (90 days + one day offset).In
assets/js/modules/analytics-4/datastore/audiences.js
file, createenableAudienceGroup
action.syncAvailableAudiences
to sync the list of available audience.getAvailableAudiences
selector.availableAudiences
byUSER_AUDIENCE
type and perform the same partial data for 90-days check using the newly introduced selector. ie.userCreatedAudiencesWithData
getReport
selector using the following args.startDate
: property creation time.endDate
: reference date.dimensions
:[ "audienceResourceName" ]
metrics
:[ "totalUsers" ]
dimensionFilters
:userCreatedAudiencesWithData
audiencesToConfigure
, up to two audience, ordered by the user count.audiencesToConfigure
is less than two, check if there areSITE_KIT_AUDIENCE
type of audiences, and add them to the list up to two in the following priority ordernew-visitors
,returning-visitors
.audienceToConfigure
is empty at this point, create the audiences defined in AC using thecreateAudience
action and added toaudienceToConfigure
.googlesitekit_post_type
custom dimension already exists in the current property using thehasCustomDimensions
selector.createCustomDimensions
action.audienceToConfigure
asconfiguredAudiences
using thesetConfiguredAudiences
and save the Settings bysaveConfiguredAudiences
.In the
AudienceSegmentationSetupCTAWidget
component:title
anddescription
prop and inline the copy passed from theAudienceSegmentationSetupCTAWidget.stories
to the component itself.getPropertyID
selector.EDIT_SCOPE
using thehasScope
selector.getConfiguredAudiences
selector.onEnableGroups
callback to handle creating audience and custom dimensions.await enableAudienceGroup
action here whenANALYTICS_EDIT_SCOPE
is available after settingisSaving
totrue
, so the CTA changes toEnabling groups
with a spinner on the right of it. (already implemented).configuredAudiences
has been set orisPropertyPartialData90Days
is true, returnnull
from the component.Create
AudienceSegmentationSetupSuccessSubtleNotification
inassets/js/modules/analytics-4/components/audience-segmentation/dashboard
folder.GA4AdSenseLinkedNotification
. Make any additional CSS changes to match the look in Figma as needed using a new class. ie.googlesitekit-subtle-notification--audience-setup-success
configuredAudiences
is set and this notification has not been dismissed.Render the
AudienceSegmentationSetupCTAWidget
inDashboardMainApp
whenaudienceSegmentation
feature flag is enabled.Render the
AudienceSegmentationSetupSuccessSubtleNotification
inSubtleNotifications
whenaudienceSegmentation
feature flag is enabled.Test Coverage
enableAudienceGroup
action.QA Brief
Prerequisites
In order to fully test this issue from a user's perspective, you will need the following:
Refer to the set up via the Analytics UI section in the design doc for some pointers on audience creation - note that these instructions are for manually creating the "new visitors" and "returning visitors" audiences, but they can be tweaked for creating other audiences with arbitrary criteria which will be needed for testing here. Once these audiences are created they will need to be populated by some site traffic which meets their criteria. For more info see the linked Google support page, and also the testing plan considerations section in the design doc for additional info on how to examine audiences in reports in the Analytics UI, so as to verify that the audiences are being populated with data (their total user counts can be examined to help verify audiences are sorted correctly).
Testing
googlesitekit_post_type
custom dimension is created if it doesn't already exist (custom dimensions can be viewed for a given Analytics property under Admin > Property settings > Data display > Custom definitions, and see this Google support page for an entry point on custom dimension documentation).To verify the synced audiences and the resulting audience selections, run the following snippets in the JS console once the setup flow is complete for each scenario:
getAvailableAudiences()
selector:Example output:
getConfiguredAudiences()
selector:Example output:
getConfiguredAudiences()
with thename
property in the values returned bygetAvailableAudiences()
to determine which audiences are selected. This snippet can automate this process:Example output:
Changelog entry
The text was updated successfully, but these errors were encountered: