diff --git a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml index a058f32994..c9e5d2aaec 100644 --- a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml +++ b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml @@ -59,6 +59,7 @@ Rectangle { } else if (walletStatus === 2) { if (root.activeView !== "passphraseModal") { root.activeView = "passphraseModal"; + UserActivityLogger.commercePassphraseEntry("marketplace checkout"); } } else if (walletStatus === 3) { authSuccessStep(); diff --git a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml index ff9ce16e93..5366bda4d6 100644 --- a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml +++ b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml @@ -54,6 +54,7 @@ Rectangle { } else if (walletStatus === 2) { if (root.activeView !== "passphraseModal") { root.activeView = "passphraseModal"; + UserActivityLogger.commercePassphraseEntry("marketplace purchases"); } } else if (walletStatus === 3) { if ((Settings.getValue("isFirstUseOfPurchases", true) || root.isDebuggingFirstUseTutorial) && root.activeView !== "firstUseTutorial") { diff --git a/interface/resources/qml/hifi/commerce/wallet/PassphraseModal.qml b/interface/resources/qml/hifi/commerce/wallet/PassphraseModal.qml index 582052c4c3..82262ebf0a 100644 --- a/interface/resources/qml/hifi/commerce/wallet/PassphraseModal.qml +++ b/interface/resources/qml/hifi/commerce/wallet/PassphraseModal.qml @@ -50,8 +50,10 @@ Item { submitPassphraseInputButton.enabled = true; if (!isAuthenticated) { errorText.text = "Authentication failed - please try again."; + UserActivityLogger.commercePassphraseAuthenticationStatus("auth failure"); } else { - sendSignalToParent({method: 'authSuccess'});; + sendSignalToParent({method: 'authSuccess'}); + UserActivityLogger.commercePassphraseAuthenticationStatus("auth success"); } } } @@ -336,6 +338,7 @@ Item { text: "Cancel" onClicked: { sendSignalToParent({method: 'passphrasePopup_cancelClicked'}); + UserActivityLogger.commercePassphraseAuthenticationStatus("passphrase modal cancelled"); } } } diff --git a/interface/resources/qml/hifi/commerce/wallet/Wallet.qml b/interface/resources/qml/hifi/commerce/wallet/Wallet.qml index ac05bf7c84..6bbf41b150 100644 --- a/interface/resources/qml/hifi/commerce/wallet/Wallet.qml +++ b/interface/resources/qml/hifi/commerce/wallet/Wallet.qml @@ -57,6 +57,7 @@ Rectangle { } else if (walletStatus === 2) { if (root.activeView !== "passphraseModal") { root.activeView = "passphraseModal"; + UserActivityLogger.commercePassphraseEntry("wallet app"); } } else if (walletStatus === 3) { root.activeView = "walletHome"; diff --git a/libraries/networking/src/UserActivityLoggerScriptingInterface.cpp b/libraries/networking/src/UserActivityLoggerScriptingInterface.cpp index 0965c9834f..aec6df4f14 100644 --- a/libraries/networking/src/UserActivityLoggerScriptingInterface.cpp +++ b/libraries/networking/src/UserActivityLoggerScriptingInterface.cpp @@ -141,3 +141,16 @@ void UserActivityLoggerScriptingInterface::commerceWalletSetupFinished(int times payload["secondsToComplete"] = secondsToComplete; doLogAction("commerceWalletSetupFinished", payload); } + +void UserActivityLoggerScriptingInterface::commercePassphraseEntry(QString source) { + QJsonObject payload; + payload["source"] = source; + doLogAction("commercePassphraseEntry", payload); +} + +void UserActivityLoggerScriptingInterface::commercePassphraseAuthenticationStatus(QString status) { + QJsonObject payload; + payload["status"] = status; + doLogAction("commercePassphraseAuthenticationStatus", payload); + +} diff --git a/libraries/networking/src/UserActivityLoggerScriptingInterface.h b/libraries/networking/src/UserActivityLoggerScriptingInterface.h index e71723f03c..0e08b050d7 100644 --- a/libraries/networking/src/UserActivityLoggerScriptingInterface.h +++ b/libraries/networking/src/UserActivityLoggerScriptingInterface.h @@ -39,6 +39,8 @@ public: Q_INVOKABLE void commerceWalletSetupStarted(int timestamp, QString setupAttemptID, int setupFlowVersion, QString referrer, QString currentDomain); Q_INVOKABLE void commerceWalletSetupProgress(int timestamp, QString setupAttemptID, int secondsElapsed, int currentStepNumber, QString currentStepName); Q_INVOKABLE void commerceWalletSetupFinished(int timestamp, QString setupAttemptID, int secondsToComplete); + Q_INVOKABLE void commercePassphraseEntry(QString source); + Q_INVOKABLE void commercePassphraseAuthenticationStatus(QString status); private: void doLogAction(QString action, QJsonObject details = {}); };