-
Notifications
You must be signed in to change notification settings - Fork 23
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
Send event for surveys shown and surveys dismissed #133
Merged
eliasyishak
merged 6 commits into
dart-lang:survey-handler-feature
from
eliasyishak:send-event-for-dismissed-surveys
Jul 28, 2023
Merged
Send event for surveys shown and surveys dismissed #133
eliasyishak
merged 6 commits into
dart-lang:survey-handler-feature
from
eliasyishak:send-event-for-dismissed-surveys
Jul 28, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eliasyishak
changed the title
Send event for dismissed surveys
Send event for surveys shown and surveys dismissed
Jul 26, 2023
9 tasks
@bkonyi I'm happy to connect offline to provide more context if needed for this review |
christopherfujino
approved these changes
Jul 27, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, modulo nits
bkonyi
approved these changes
Jul 28, 2023
eliasyishak
merged commit Jul 28, 2023
ae5cc41
into
dart-lang:survey-handler-feature
2 checks passed
eliasyishak
added a commit
that referenced
this pull request
Aug 3, 2023
* Survey handler functionality to fetch available surveys (#91) * Add constant for endpoint that stores metadata json file * Development began on survey handler class with fetch * Update survey_handler.dart * Parsing functionality added in `survey_handler` * Condition class `operator` relabeled to `operatorString` * `Analytics` test and default constructors to use `SurveyHandler` * Refactor + cleanup + error handling * `dart format` fix * Evaluating functionality added to `Analytics` * Format fix * `!=` operator added to `Condition` class * Refactor for fake survey handler to use list of surveys or string * Initial test cases added * Tests added to use json in `FakeSurveyHandler` * Fix nit * Early exit if on null `logFileStats` * Test to check each field in `Survey` and `Condition` * Documentation update * No surveys returned for opted out users * Revert "No surveys returned for opted out users" This reverts commit f6d9f8e. * No surveys for opted out users (#99) * Check `okToSend` before fetching surveys * Added test * dart format fix * Update CHANGELOG.md * Mark as dev * Change version suffix * `dart fix --apply --code=combinators_ordering` * Fix `survey_handler.dart` with new lints * Add'l fixes to survey_handler * Remove left hand types from `analytics.dart` * Fix `survey_handler_test.dart` with new lints * Fix tests with survey_handler class from lint fixes * `dart format` fix * Sampling rate functionality added (#122) * Sampling rate functionality added * Update tests to have 100% sampling rate * Tests added to test sampling rate * Update survey_handler_test.dart * Fix type for `jsonDecode` * New utility function to convert string into integer * Fix tests with new outputs for sample rate * Use uniqueId for survey instead of description * Add hyphen to lookup * Fix documentation * Fix survey handler tests to use new .send method * Fix tests to use new maps for `LogFileStats` * Dismissing and persisting surveys (#127) * Add constant for new file name + clean up session handler Removing NoOp session instance since that was only being used before `2.0.0` * Updating survey handler to create file to persist ids * Revert changes to session handler * Update constant to be a json file * Initialize dismiss surveys file with empty json * Initializer for dismissed file made static * Functionality added to check if survey snoozed or dismissed * Dismiss functionality added * `dismissForDays` -> `dismissForMinutes` * Update survey_handler_test.dart * Clean up external functions to be class methods * Tests added for snoozing and dismissing permanently * Test added for malformed json * Check sample rate before using LogFileStats * Add `surveyShown` API to snooze surveys * Use new URL for survey metadata * Error handling for missing json file * Sample rate example added (#130) * Added example file * Including example's output in code * Update sample_rate.dart * Fix nits * Send event for surveys shown and surveys dismissed (#133) * Added enum and event constructor survey actions * Fix format errors * Using two events for survey shown and survey action * Created mock class to confirm events are sent * Clean up constructors * Fix nits * Refactor for buttons array with `SurveyButton` class (#134) * Added newe `SurveyButton` class * Fix tests * Add documentation for enums * Update sample_rate.dart * Update tests to check for `SurveyButton` classes * Remove enum for status of action * Use `snoozeForMinutes` instead of dismiss * Expose `SurveyButton` * Fixing documentation for event class * Order members in survey handler * Refactor to pass button to `surveyInteracted(..)` * `surveyButtonList` --> `buttonList` renaming * Adding example file for how to use survey handler feature * Adding conditional check for url to display * Format fix * Allow surveys with no conditions to be passed Only checking if `logFileStats` is null if there is a condition in the condition array in the json * Update version * Simplify utility functions for sample rate + check date * `const` constructor for `Survey` unnamed constructor * Fix test to unit test sampling function * Fix dartdocs + check for null outside loop + breaks removed * Add documentation to example files * `dart format` * Catch `TypeError` when parsing json survey * Adding tests for the sampling rate with margin of error
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Umbrella tracking issue:
This update will emit events to GA4 whenever there is action taken by a developer after being prompted with a survey
There are three states that can be communicated to GA4, the survey will be one of the following:
snoozed
- this occurs whenever the survey has been shown but the user has not interacted with it (interaction will depend on the tool using this package, but for VS Code, this can be when the pop up disappears on its own)accepted
- the user has clicked into what we have shared, ie. a survey prompt, product announcement, etc.dismissed
- the user has decided to permanently dismiss the survey (in VS Code, this can be if they clicked the X button on the pop up (if we can get a signal from that action), or an explicitDismiss
buttonContribution guidelines:
dart format
.Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.