diff --git a/lib/setup/screens.dart b/lib/setup/screens.dart index d2fa732e..67ccff13 100644 --- a/lib/setup/screens.dart +++ b/lib/setup/screens.dart @@ -477,25 +477,38 @@ class GitHostSetupScreenState extends State { await repo.commit(message: "Add gitignore file"); } - String hostType = "Unknown"; - if (_gitCloneUrl.contains("github.com")) { - hostType = "GitHub"; - } else if (_gitCloneUrl.contains("gitlab.org")) { - hostType = "GitLab.org"; - } else if (_gitCloneUrl.contains("gitlab")) { - hostType = "GitLab"; - } - getAnalytics().logEvent( name: "onboarding_complete", - parameters: { - "host_type": hostType, - }, + parameters: _buildOnboardingAnalytics(), ); Navigator.pop(context); widget.onCompletedFunction(); } + Map _buildOnboardingAnalytics() { + var map = {}; + + if (_gitCloneUrl.contains("github.com")) { + map["host_type"] = "GitHub"; + } else if (_gitCloneUrl.contains("gitlab.org")) { + map["host_type"] = "GitLab.org"; + } else if (_gitCloneUrl.contains("gitlab")) { + map["host_type"] = "GitLab"; + } + + var ch0 = _pageChoice[0] as PageChoice0; + map["provider_choice"] = ch0.toString().replaceFirst("PageChoice0.", ""); + + var ch1 = _pageChoice[1] as PageChoice1; + map["setup_manner"] = ch1.toString().replaceFirst("PageChoice1.", ""); + + map["key_generation"] = _keyGenerationChoice + .toString() + .replaceFirst("KeyGenerationChoice.", ""); + + return map; + } + Future _removeExistingClone(String baseDirPath) async { var baseDir = Directory(p.join(baseDirPath, "journal")); var dotGitDir = Directory(p.join(baseDir.path, ".git"));