-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: [IOPID-2137,IOPID-2479] CieID events integration (#6428)
## Short description This PR adds event tracking to the `CieID` login flow and edit copy on `CieIdWizard` screen ## List of changes proposed in this pull request - Added event tracking for the various scenarios in the new `CieID` login flow. - Updated some `SPID` error events with the addition of some event `properties` - Updated `CieIdWizard` description ## Demo <details><summary>Test wizards</summary> <video src="https://github.com/user-attachments/assets/5f2469b5-5eae-45f7-8874-e5da3e61e0b7"></video> </details> <details><summary>Test operation cancel and login success</summary> <video src="https://github.com/user-attachments/assets/506e0a29-2720-46c2-b21b-aaa4e908cc4c"></video> </details> ## Screen <img width=300 src="https://github.com/user-attachments/assets/05edcd72-ac6c-4361-bbb4-28cabdf89153" /> ## How to test Run the app and navigate through the `CieID` login/wizards flows and check if all the events are properly dispatched. ### Events table <details> | TAG | EVENT NAME | EVENT CATEGORY | EVENT TYPE | TRIGGER | PROPERTY 1 | PROPERTY 2 | |:----------|:---------------------------------------|:-------------------|:-------------|:------------------------------------------------------------------|:-------------------------|:-------------------------| |New | LOGIN_CIE_IDENTIFICATION_MODE | UX | screen view | screen view > bottom sheet “How do you want to login?” | | | |New | LOGIN_CIE_WIZARD_SELECTED | UX | action | tap > "We give you a hand” | | | |New | LOGIN_CIE_WIZARD_CIEID | UX | screen view | screen view > “Do you have the CieID app?” | | | |New | LOGIN_CIE_WIZARD_CIEID_SELECTED | UX | action | tap > "Yes, log in with CieID" | | | |New | LOGIN_CIE_WIZARD_PIN | UX | screen view | screen view > “Do you have your Electronic Identity Card and PIN?”| | | |New | LOGIN_CIE_WIZARD_PIN_INFO | UX | action | tap > "Where can I find the CIE PIN?" | | | |New | LOGIN_CIE_WIZARD_PIN_SELECTED | UX | action | tap > "Yes, enter with CIE + PIN" | | | |New | LOGIN_CIE_WIZARD_SPID | UX | screen view | screen view > “Do you have SPID?” | | | |New | LOGIN_CIE_WIZARD_SPID_SELECTED | UX | action | tap > "Yes, login with SPID" | | | |New | LOGIN_CIE_WIZARD_IDP_ACTIVATION | UX | screen view | screen view > "Activate your digital identity!" | | | |New | LOGIN_CIE_PIN_SELECTED | UX | action | tap > "Login with CIE + PIN" | | | |New | LOGIN_CIEID_SELECTED | UX | action | tap > "Login with CieID" | security_level = L2 / L3 | | |New | LOGIN_CIEID_APP_NOT_FOUND | KO | error | screen > "We can't find the CieID app" | | | |New | LOGIN_CIEID_APP_NOT_FOUND_DOWNLOAD | UX | action | tap > "scarica CieID" | | | |New | LOGIN_CIEID_UX_SUCCESS | UX | confirm | Login with CieID success | login_session= 365 / 30 | | |New | LOGIN_ERROR_MESSAGE | KO | error | screen view > "It was not possible to access" | idp |error message | |New | LOGIN_CIEID_FALLBACK_CIE_PIN | KO | | screen > "Can't log in with CieID?" | | | |New | LOGIN_CIEID_FALLBACK_CIE_PIN_SELECTED | UX | action | tap > "Login with CIE + PIN" | | | |New | LOGIN_CIEID_FALLBACK_SPID | KO | | screen > "Can't log in with CieID?" | | | |New | LOGIN_CIEID_FALLBACK_CIE_SPID_SELECTED | UX | action | tap > "Login with SPID" | | | |Updated | LOGIN_SPID_GENERIC_ERROR | KO | | event > "Generic error" | idp | error message | |Updated | LOGIN_SPID_ATTEMPTS_ERROR | KO | | event > "Max login attempts reached" | idp | | |Updated | LOGIN_SPID_SECURITY_LEVEL | KO | | event > "Security level" | idp | | |Updated | LOGIN_SPID_TIMEOUT_ERROR | KO | | event > "Timeout error" | idp | | |Updated | LOGIN_SPID_DATA_SHARING_ERROR | KO | | event > "Data sharing consent denied" | idp | | |Updated | LOGIN_SPID_IDENTITY_ERROR | KO | | event > "Identity suspended or revoked" | idp | | |Updated | LOGIN_SPID_CANCEL_ERROR | KO | | event > "login cancelled by the user" | idp | | </details> --------- Co-authored-by: mariateresaventura <[email protected]>
- Loading branch information
1 parent
33a36c5
commit 4954500
Showing
26 changed files
with
449 additions
and
123 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"io_session_manager_api": "https://raw.githubusercontent.com/pagopa/io-auth-n-identity-domain/[email protected]/apps/io-session-manager/api/internal.yaml", | ||
"io_session_manager_public_api": "https://raw.githubusercontent.com/pagopa/io-auth-n-identity-domain/[email protected]/apps/io-session-manager/api/public.yaml", | ||
"io_public_api": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/api_public.yaml", | ||
"io_content_specs": "https://raw.githubusercontent.com/pagopa/io-services-metadata/1.0.46/definitions.yml", | ||
"io_content_specs": "https://raw.githubusercontent.com/pagopa/io-services-metadata/1.0.47/definitions.yml", | ||
"io_cgn_specs": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/api_cgn.yaml", | ||
"io_cgn_merchants_specs": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/api_cgn_operator_search.yaml", | ||
"api_fci": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/api_io_sign.yaml", | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
import { IdpCIE, IdpCIE_ID } from "../../../hooks/useNavigateToLoginMethod"; | ||
import { mixpanelTrack } from "../../../mixpanel"; | ||
import { updateMixpanelProfileProperties } from "../../../mixpanelConfig/profileProperties"; | ||
import { GlobalState } from "../../../store/reducers/types"; | ||
import { buildEventProperties } from "../../../utils/analytics"; | ||
import { SpidLevel } from "../../cieLogin/utils"; | ||
|
||
const SECURITY_LEVEL_MAP: Record<SpidLevel, "L2" | "L3"> = { | ||
SpidL2: "L2", | ||
SpidL3: "L3" | ||
}; | ||
|
||
// Wizards screen view events | ||
export const trackCieIdWizardScreen = async () => { | ||
void mixpanelTrack( | ||
"LOGIN_CIE_WIZARD_CIEID", | ||
buildEventProperties("UX", "screen_view") | ||
); | ||
}; | ||
export const trackCiePinWizardScreen = async () => { | ||
void mixpanelTrack( | ||
"LOGIN_CIE_WIZARD_PIN", | ||
buildEventProperties("UX", "screen_view") | ||
); | ||
}; | ||
export const trackSpidWizardScreen = async () => { | ||
void mixpanelTrack( | ||
"LOGIN_CIE_WIZARD_SPID", | ||
buildEventProperties("UX", "screen_view") | ||
); | ||
}; | ||
export const trackIdpActivationWizardScreen = async () => { | ||
void mixpanelTrack( | ||
"LOGIN_CIE_WIZARD_IDP_ACTIVATION", | ||
buildEventProperties("UX", "screen_view") | ||
); | ||
}; | ||
|
||
// Wizards action events | ||
export const trackWizardCieIdSelected = async ( | ||
state: GlobalState, | ||
spidLevel: SpidLevel | ||
) => { | ||
await updateMixpanelProfileProperties(state, { | ||
property: "LOGIN_METHOD", | ||
value: IdpCIE_ID.id | ||
}); | ||
void mixpanelTrack( | ||
"LOGIN_CIE_WIZARD_CIEID_SELECTED", | ||
buildEventProperties("UX", "action", { | ||
security_level: SECURITY_LEVEL_MAP[spidLevel] | ||
}) | ||
); | ||
}; | ||
export const trackWizardCiePinSelected = async (state: GlobalState) => { | ||
await updateMixpanelProfileProperties(state, { | ||
property: "LOGIN_METHOD", | ||
value: IdpCIE.id | ||
}); | ||
void mixpanelTrack( | ||
"LOGIN_CIE_WIZARD_PIN_SELECTED", | ||
buildEventProperties("UX", "action") | ||
); | ||
}; | ||
export const trackWizardCiePinInfoSelected = async () => { | ||
void mixpanelTrack( | ||
"LOGIN_CIE_WIZARD_PIN_INFO", | ||
buildEventProperties("UX", "action") | ||
); | ||
}; | ||
export const trackWizardSpidSelected = async () => { | ||
void mixpanelTrack( | ||
"LOGIN_CIE_WIZARD_SPID_SELECTED", | ||
buildEventProperties("UX", "action") | ||
); | ||
}; | ||
|
||
// Cie id not installed screen view events | ||
export const trackCieIdNotInstalledScreen = async () => { | ||
void mixpanelTrack( | ||
"LOGIN_CIEID_APP_NOT_FOUND", | ||
buildEventProperties("KO", "error") | ||
); | ||
}; | ||
// Cie id not installed action events | ||
export const trackCieIdNotInstalledDownloadAction = async () => { | ||
void mixpanelTrack( | ||
"LOGIN_CIEID_APP_NOT_FOUND_DOWNLOAD", | ||
buildEventProperties("UX", "action") | ||
); | ||
}; | ||
|
||
// Cie Id error screen view events | ||
export const trackCieIdErrorCiePinFallbackScreen = async () => { | ||
void mixpanelTrack( | ||
"LOGIN_CIEID_FALLBACK_CIE_PIN", | ||
buildEventProperties("KO", undefined) | ||
); | ||
}; | ||
export const trackCieIdErrorSpidFallbackScreen = async () => { | ||
void mixpanelTrack( | ||
"LOGIN_CIEID_FALLBACK_SPID", | ||
buildEventProperties("KO", undefined) | ||
); | ||
}; | ||
|
||
// Cie Id error screen action events | ||
export const trackCieIdErrorCiePinSelected = async () => { | ||
void mixpanelTrack( | ||
"LOGIN_CIEID_FALLBACK_CIE_PIN_SELECTED", | ||
buildEventProperties("UX", "action") | ||
); | ||
}; | ||
export const trackCieIdErrorSpidSelected = async () => { | ||
void mixpanelTrack( | ||
"LOGIN_CIEID_FALLBACK_CIE_SPID_SELECTED", | ||
buildEventProperties("UX", "action") | ||
); | ||
}; |
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
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.