121117 added event triggers

This commit is contained in:
2024-08-29 14:47:22 +01:00
parent afe79b079a
commit c0404d138a
7 changed files with 99 additions and 37 deletions
+14 -1
View File
@@ -3,6 +3,7 @@ import Link from "next/link";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, reduxForm } from "redux-form";
import { sendGAEvent } from "@next/third-parties/google";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
@@ -126,7 +127,19 @@ let CaseSearch = (props) => {
/>
<div className="govuk-form-group">
<button type="submit" className="govuk-button">
<button
type="submit"
className="govuk-button"
onClick={() => {
sendGAEvent(
"event",
"SearchButtonClicked",
{
searchTerm: basicSearch.value,
}
);
}}
>
{t("home:casesearch-card-button")}
</button>
</div>