Add startup_sent_to user activity event
Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all
Unified · Split
| @@ -2410,15 +2410,16 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 2409 unmodified lines | ||
| 2410 | 2410 | |
| 2411 | 2411 | // Check HMD use (may be technically available without being in use) |
| 2412 | 2412 | bool hasHMD = PluginUtils::isHMDAvailable(); |
| 2413 | − bool isUsingHMD = hasHMD && hasHandControllers && _displayPlugin->isHmd(); | |
| 2413 | + bool isUsingHMD = _displayPlugin->isHmd(); | |
| 2414 | + bool isUsingHMDAndHandControllers = hasHMD && hasHandControllers && isUsingHMD; | |
| 2414 | 2415 | |
| 2415 | 2416 | Setting::Handle<bool> tutorialComplete{ "tutorialComplete", false }; |
| 2416 | 2417 | Setting::Handle<bool> firstRun{ Settings::firstRun, true }; |
| 2417 | 2418 | |
| 2418 | 2419 | bool isTutorialComplete = tutorialComplete.get(); |
| 2419 | − bool shouldGoToTutorial = isUsingHMD && hasTutorialContent && !isTutorialComplete; | |
| 2420 | + bool shouldGoToTutorial = isUsingHMDAndHandControllers && hasTutorialContent && !isTutorialComplete; | |
| 2420 | 2421 | |
| 2421 | − qCDebug(interfaceapp) << "HMD:" << hasHMD << ", Hand Controllers: " << hasHandControllers << ", Using HMD: " << isUsingHMD; | |
| 2422 | + qCDebug(interfaceapp) << "HMD:" << hasHMD << ", Hand Controllers: " << hasHandControllers << ", Using HMD: " << isUsingHMDAndHandControllers; | |
| 2422 | 2423 | qCDebug(interfaceapp) << "Tutorial version:" << contentVersion << ", sufficient:" << hasTutorialContent << |
| 2423 | 2424 | ", complete:" << isTutorialComplete << ", should go:" << shouldGoToTutorial; |
| 2424 | 2425 | |
| @@ -2432,10 +2433,18 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 7 unmodified lines | ||
| 2432 | 2433 | |
| 2433 | 2434 | const QString TUTORIAL_PATH = "/tutorial_begin"; |
| 2434 | 2435 | |
| 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 | + | |
| 2435 | 2443 | if (shouldGoToTutorial) { |
| 2436 | 2444 | if (sandboxIsRunning) { |
| 2437 | 2445 | qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home."; |
| 2438 | 2446 | DependencyManager::get<AddressManager>()->goToLocalSandbox(TUTORIAL_PATH); |
| 2447 | + sentTo = SENT_TO_TUTORIAL; | |
| 2439 | 2448 | } else { |
| 2440 | 2449 | qCDebug(interfaceapp) << "Home sandbox does not appear to be running, going to Entry."; |
| 2441 | 2450 | if (firstRun.get()) { |
| @@ -2443,8 +2452,10 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 1 unmodified line | ||
| 2443 | 2452 | } |
| 2444 | 2453 | if (addressLookupString.isEmpty()) { |
| 2445 | 2454 | DependencyManager::get<AddressManager>()->goToEntry(); |
| 2455 | + sentTo = SENT_TO_ENTRY; | |
| 2446 | 2456 | } else { |
| 2447 | 2457 | DependencyManager::get<AddressManager>()->loadSettings(addressLookupString); |
| 2458 | + sentTo = SENT_TO_PREVIOUS_LOCATION; | |
| 2448 | 2459 | } |
| 2449 | 2460 | } |
| 2450 | 2461 | } else { |
| @@ -2457,23 +2468,40 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 6 unmodified lines | ||
| 2457 | 2468 | |
| 2458 | 2469 | // If this is a first run we short-circuit the address passed in |
| 2459 | 2470 | if (isFirstRun) { |
| 2460 | − if (isUsingHMD) { | |
| 2471 | + if (isUsingHMDAndHandControllers) { | |
| 2461 | 2472 | if (sandboxIsRunning) { |
| 2462 | 2473 | qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home."; |
| 2463 | 2474 | DependencyManager::get<AddressManager>()->goToLocalSandbox(); |
| 2475 | + sentTo = SENT_TO_SANDBOX; | |
| 2464 | 2476 | } else { |
| 2465 | 2477 | qCDebug(interfaceapp) << "Home sandbox does not appear to be running, going to Entry."; |
| 2466 | 2478 | DependencyManager::get<AddressManager>()->goToEntry(); |
| 2479 | + sentTo = SENT_TO_ENTRY; | |
| 2467 | 2480 | } |
| 2468 | 2481 | } else { |
| 2469 | 2482 | DependencyManager::get<AddressManager>()->goToEntry(); |
| 2483 | + sentTo = SENT_TO_ENTRY; | |
| 2470 | 2484 | } |
| 2471 | 2485 | } else { |
| 2472 | 2486 | qCDebug(interfaceapp) << "Not first run... going to" << qPrintable(addressLookupString.isEmpty() ? QString("previous location") : addressLookupString); |
| 2473 | 2487 | DependencyManager::get<AddressManager>()->loadSettings(addressLookupString); |
| 2488 | + sentTo = SENT_TO_PREVIOUS_LOCATION; | |
| 2474 | 2489 | } |
| 2475 | 2490 | } |
| 2476 | 2491 | |
| 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 | + | |
| 2477 | 2505 | _connectionMonitor.init(); |
| 2478 | 2506 | |
| 2479 | 2507 | // After all of the constructor is completed, then set firstRun to false. |