Merged in fix/SW-3115-form-tracking-changes (pull request #2470)

fix(SW-3115): add form complete tracking and removed input error tracking

* fix(SW-3115): add form complete tracking and removed input error tracking


Approved-by: Bianca Widstam
This commit is contained in:
Tobias Johansson
2025-07-01 06:44:08 +00:00
committed by Bianca Widstam
parent 86bd3fcea3
commit d272cd03ce
5 changed files with 63 additions and 40 deletions

View File

@@ -79,3 +79,25 @@ export function trackFormValidationError(
})
}
}
export function trackFormCompletion(type: FormType, nameSuffix?: string) {
if (type === "checkout") {
trackEvent({
event: "formCompletion",
form: {
action: "checkout form completion",
name: "checkout enter detail" + nameSuffix,
type: type,
},
})
} else if (type === "signup") {
trackEvent({
event: "formCompletion",
form: {
action: "signup form completion",
name: "member registration" + nameSuffix,
type: type,
},
})
}
}