-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix(analytics): [DERG-1502 ]Account sign up #546
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e433266
add event tracking to sign up
d813bd0
add rudderstack events
485428f
refactor
5900d6a
add error flow event
adc36ac
Merge remote-tracking branch 'upstream/master' into Account_sign_up
353316c
Merge remote-tracking branch 'upstream/master' into Account_sign_up
ca7d8ee
test
4fa2767
refactor events
2a32fcb
fix comment
91ef68b
Merge branch 'master' into Account_sign_up
ilya-deriv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
186 changes: 186 additions & 0 deletions
186
packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
import 'package:analytics/sdk/rudderstack/core/rudderstack_configuration.dart'; | ||
import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; | ||
import 'package:rudder_sdk_flutter_platform_interface/platform.dart'; | ||
|
||
/// Class which hold events which should be monitored. | ||
class DerivRudderstackEvents { | ||
/// Constructor for [DerivRudderstackEvents]. | ||
const DerivRudderstackEvents(); | ||
|
||
///Set ups Rudderstack connection. | ||
void setup({required String dataPlaneUrl, required String writeKey}) { | ||
DerivRudderstack().setup( | ||
RudderstackConfiguration(dataPlaneUrl: dataPlaneUrl, writeKey: writeKey), | ||
); | ||
} | ||
|
||
/// Captures app_open event when the app is opened. | ||
void logAppOpened() { | ||
DerivRudderstack().track( | ||
eventName: 'ce_virtual_signup_form', | ||
properties: RudderProperty.fromMap(<String, dynamic>{ | ||
'action': 'open', | ||
'form_source': 'mobile_derivgo', | ||
'form_name': 'virtual_signup_derivgo' | ||
}), | ||
); | ||
} | ||
|
||
/// Captures user tap on Log in button on sign up screen. | ||
void logUserTappedLoginButton() { | ||
DerivRudderstack().track( | ||
eventName: 'ce_virtual_signup_form', | ||
properties: RudderProperty.fromMap(<String, dynamic>{ | ||
'action': 'go_to_login', | ||
'form_source': 'mobile_derivgo', | ||
'form_name': 'virtual_signup_derivgo' | ||
}), | ||
); | ||
} | ||
|
||
/// Captures user tap on Get free account button on sign up screen. | ||
void logAppGetFreeAccount(String slideName) { | ||
DerivRudderstack().track( | ||
eventName: 'ce_virtual_signup_form', | ||
properties: RudderProperty.fromMap(<String, dynamic>{ | ||
'action': 'get_free_account', | ||
'form_source': 'mobile_derivgo', | ||
'getstarted_slide_name': | ||
'${slideName.substring(slideName.indexOf('.') + 1, slideName.length)}', | ||
'form_name': 'virtual_signup_derivgo' | ||
}), | ||
); | ||
} | ||
|
||
/// Tracks when user turns on or off Refferal toggle switcher. | ||
void logReferralToggleSwitched() { | ||
DerivRudderstack().track( | ||
eventName: 'ce_virtual_signup_form', | ||
properties: RudderProperty.fromMap(<String, dynamic>{ | ||
'action': 'tab_referral_toggle', | ||
'form_source': 'mobile_derivgo', | ||
'form_name': 'virtual_signup_derivgo' | ||
}), | ||
); | ||
} | ||
|
||
/// Tracks when user gets Invalid referral code pop up with Try again button. | ||
void logTryAgainReferralCode() { | ||
DerivRudderstack().track( | ||
eventName: 'ce_virtual_signup_form', | ||
properties: RudderProperty.fromMap(<String, dynamic>{ | ||
'action': 'try_again_referral_code', | ||
'form_source': 'mobile_derivgo', | ||
'form_name': 'virtual_signup_derivgo' | ||
}), | ||
); | ||
} | ||
|
||
/// Tracks when Email confirmation is sent to a user. | ||
void logEmailConfirmationSent() { | ||
DerivRudderstack().track( | ||
eventName: 'ce_virtual_signup_form', | ||
properties: RudderProperty.fromMap(<String, dynamic>{ | ||
'action': 'email_confirmation_sent', | ||
'signup_provider': 'email', | ||
'form_source': 'mobile_derivgo', | ||
'form_name': 'virtual_signup_derivgo' | ||
}), | ||
); | ||
} | ||
|
||
/// Tracks when user land on Successfull email verification screen. | ||
void logEmailConfirmed() { | ||
DerivRudderstack().track( | ||
eventName: 'ce_virtual_signup_form', | ||
properties: RudderProperty.fromMap(<String, dynamic>{ | ||
'action': 'email_confirmed', | ||
'signup_provider': 'email', | ||
'form_source': 'mobile_derivgo', | ||
'form_name': 'virtual_signup_derivgo' | ||
}), | ||
); | ||
} | ||
|
||
/// Tracks when user taps Continue button on Successfull email verification screen. | ||
void logSignupContinued() { | ||
DerivRudderstack().track( | ||
eventName: 'ce_virtual_signup_form', | ||
properties: RudderProperty.fromMap(<String, dynamic>{ | ||
'action': 'signup_continued', | ||
'signup_provider': 'email', | ||
'form_source': 'mobile_derivgo', | ||
'form_name': 'virtual_signup_derivgo' | ||
}), | ||
); | ||
} | ||
|
||
/// Tracks when user lands on Country selection screen. | ||
void logCountrySelectionPageOpened() { | ||
DerivRudderstack().track( | ||
eventName: 'ce_virtual_signup_form', | ||
properties: RudderProperty.fromMap(<String, dynamic>{ | ||
'action': 'country_selection_screen_opened', | ||
'signup_provider': 'email', | ||
'form_source': 'mobile_derivgo', | ||
'form_name': 'virtual_signup_derivgo' | ||
}), | ||
); | ||
} | ||
|
||
/// Tracks when user lands on Create password page while creating demo account. | ||
void logSetPasswordPageOpened() { | ||
DerivRudderstack().track( | ||
eventName: 'ce_virtual_signup_form', | ||
properties: RudderProperty.fromMap(<String, dynamic>{ | ||
'action': 'password_screen_opened', | ||
'signup_provider': 'email', | ||
'form_source': 'mobile_derivgo', | ||
'form_name': 'virtual_signup_derivgo' | ||
}), | ||
); | ||
} | ||
|
||
/// Tracks when user's sign up is finished. | ||
void logSignUpDone(String signupProvider) { | ||
DerivRudderstack().track( | ||
eventName: 'ce_virtual_signup_form', | ||
properties: RudderProperty.fromMap(<String, dynamic>{ | ||
'action': 'signup_done', | ||
'signup_provider': '$signupProvider', | ||
'form_source': 'mobile_derivgo', | ||
'form_name': 'virtual_signup_derivgo' | ||
}), | ||
); | ||
} | ||
|
||
/// Tracks when user taps 'Create free demo account' or social log in button. | ||
void logSignUpPageAction(String signupProvider, | ||
[bool? isToggleOn, String? referralCode]) { | ||
DerivRudderstack().track( | ||
eventName: 'ce_virtual_signup_form', | ||
properties: RudderProperty.fromMap(<String, dynamic>{ | ||
'action': 'started', | ||
'signup_provider': '$signupProvider', | ||
'referral_toggle_mode': '${isToggleOn ?? false} ', | ||
'referral_code': '$referralCode', | ||
'form_source': 'mobile_derivgo', | ||
'form_name': 'virtual_signup_derivgo' | ||
}), | ||
); | ||
} | ||
|
||
/// Tracks any error is happening and shown to the user (validation, API communication, social providers errors). | ||
void logSignUpFlowError(String? errorText, [String? signupProvider]) { | ||
DerivRudderstack().track( | ||
eventName: 'ce_virtual_signup_form', | ||
properties: RudderProperty.fromMap(<String, dynamic>{ | ||
'action': 'signup_flow_error', | ||
'signup_provider': '$signupProvider', | ||
'error_message': '$errorText', | ||
'form_source': 'mobile_derivgo', | ||
'form_name': 'virtual_signup_derivgo' | ||
}), | ||
); | ||
} | ||
} | ||
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
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
Oops, something went wrong.
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.
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.
rudderanalytics.track("ce_virtual_signup_form", { action: "signup_flow_error", signup_provider: "facebook", error_message: "Some error description", form_source: "mobile_derivgo", form_name: "virtual_signup_derivgo" })
Is missed. Is there any specific reason?