History

Merge pull request #10606 from huffman/feat/startup-went-to-event

Add startup_sent_to user activity event

Ryan Huffman committed 9 years ago

Commit c0bca732 parents 34201ea 0fdbf4a1 file · +32 −4Browse files

Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all

Unified · Split

interface/src/Application.cpp+32−4
@@ -2410,15 +2410,16 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 2409 unmodified lines
24102410
24112411 // Check HMD use (may be technically available without being in use)
24122412 bool hasHMD = PluginUtils::isHMDAvailable();
2413− bool isUsingHMD = hasHMD && hasHandControllers && _displayPlugin->isHmd();
2413+ bool isUsingHMD = _displayPlugin->isHmd();
2414+ bool isUsingHMDAndHandControllers = hasHMD && hasHandControllers && isUsingHMD;
24142415
24152416 Setting::Handle<bool> tutorialComplete{ "tutorialComplete", false };
24162417 Setting::Handle<bool> firstRun{ Settings::firstRun, true };
24172418
24182419 bool isTutorialComplete = tutorialComplete.get();
2419− bool shouldGoToTutorial = isUsingHMD && hasTutorialContent && !isTutorialComplete;
2420+ bool shouldGoToTutorial = isUsingHMDAndHandControllers && hasTutorialContent && !isTutorialComplete;
24202421
2421− qCDebug(interfaceapp) << "HMD:" << hasHMD << ", Hand Controllers: " << hasHandControllers << ", Using HMD: " << isUsingHMD;
2422+ qCDebug(interfaceapp) << "HMD:" << hasHMD << ", Hand Controllers: " << hasHandControllers << ", Using HMD: " << isUsingHMDAndHandControllers;
24222423 qCDebug(interfaceapp) << "Tutorial version:" << contentVersion << ", sufficient:" << hasTutorialContent <<
24232424 ", complete:" << isTutorialComplete << ", should go:" << shouldGoToTutorial;
24242425
@@ -2432,10 +2433,18 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 7 unmodified lines
24322433
24332434 const QString TUTORIAL_PATH = "/tutorial_begin";
24342435
2436+ static const QString SENT_TO_TUTORIAL = "tutorial";
2437+ static const QString SENT_TO_PREVIOUS_LOCATION = "previous_location";
2438+ static const QString SENT_TO_ENTRY = "entry";
2439+ static const QString SENT_TO_SANDBOX = "sandbox";
2440+
2441+ QString sentTo;
2442+
24352443 if (shouldGoToTutorial) {
24362444 if (sandboxIsRunning) {
24372445 qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home.";
24382446 DependencyManager::get<AddressManager>()->goToLocalSandbox(TUTORIAL_PATH);
2447+ sentTo = SENT_TO_TUTORIAL;
24392448 } else {
24402449 qCDebug(interfaceapp) << "Home sandbox does not appear to be running, going to Entry.";
24412450 if (firstRun.get()) {
@@ -2443,8 +2452,10 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 1 unmodified line
24432452 }
24442453 if (addressLookupString.isEmpty()) {
24452454 DependencyManager::get<AddressManager>()->goToEntry();
2455+ sentTo = SENT_TO_ENTRY;
24462456 } else {
24472457 DependencyManager::get<AddressManager>()->loadSettings(addressLookupString);
2458+ sentTo = SENT_TO_PREVIOUS_LOCATION;
24482459 }
24492460 }
24502461 } else {
@@ -2457,23 +2468,40 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 6 unmodified lines
24572468
24582469 // If this is a first run we short-circuit the address passed in
24592470 if (isFirstRun) {
2460− if (isUsingHMD) {
2471+ if (isUsingHMDAndHandControllers) {
24612472 if (sandboxIsRunning) {
24622473 qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home.";
24632474 DependencyManager::get<AddressManager>()->goToLocalSandbox();
2475+ sentTo = SENT_TO_SANDBOX;
24642476 } else {
24652477 qCDebug(interfaceapp) << "Home sandbox does not appear to be running, going to Entry.";
24662478 DependencyManager::get<AddressManager>()->goToEntry();
2479+ sentTo = SENT_TO_ENTRY;
24672480 }
24682481 } else {
24692482 DependencyManager::get<AddressManager>()->goToEntry();
2483+ sentTo = SENT_TO_ENTRY;
24702484 }
24712485 } else {
24722486 qCDebug(interfaceapp) << "Not first run... going to" << qPrintable(addressLookupString.isEmpty() ? QString("previous location") : addressLookupString);
24732487 DependencyManager::get<AddressManager>()->loadSettings(addressLookupString);
2488+ sentTo = SENT_TO_PREVIOUS_LOCATION;
24742489 }
24752490 }
24762491
2492+ UserActivityLogger::getInstance().logAction("startup_sent_to", {
2493+ { "sent_to", sentTo },
2494+ { "sandbox_is_running", sandboxIsRunning },
2495+ { "has_hmd", hasHMD },
2496+ { "has_hand_controllers", hasHandControllers },
2497+ { "is_using_hmd", isUsingHMD },
2498+ { "is_using_hmd_and_hand_controllers", isUsingHMDAndHandControllers },
2499+ { "content_version", contentVersion },
2500+ { "is_tutorial_complete", isTutorialComplete },
2501+ { "has_tutorial_content", hasTutorialContent },
2502+ { "should_go_to_tutorial", shouldGoToTutorial }
2503+ });
2504+
24772505 _connectionMonitor.init();
24782506
24792507 // After all of the constructor is completed, then set firstRun to false.