121117 added event triggers
This commit is contained in:
+2
-1
@@ -46,7 +46,8 @@ RELAYPATH = "dev-pedw-hc"
|
||||
//RELAYPATH = "prod-pedw-hc"
|
||||
|
||||
|
||||
GOOGLE_TAG_MANAGER = GTM-T78CBC3
|
||||
//GOOGLE_TAG_MANAGER = GTM-T78CBC3
|
||||
GOOGLE_TAG_MANAGER = G-GTWW3JT03Z
|
||||
SHOWLOGIN = true
|
||||
SHOWREPRESENTATIONS = true
|
||||
SHOWFILEUPLOAD = "false"
|
||||
|
||||
@@ -7,6 +7,7 @@ import { connect } from "react-redux";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import { formatDates } from "../utils";
|
||||
import PaginationControl from "./pagination";
|
||||
import { sendGAEvent } from "@next/third-parties/google";
|
||||
|
||||
import {
|
||||
getSearchDocumentDetails,
|
||||
@@ -66,9 +67,6 @@ const DocumentDetails = (props) => {
|
||||
console.log(currentDate);
|
||||
|
||||
var valid = startDate < currentDate && endDate > currentDate;
|
||||
|
||||
console.log(valid);
|
||||
|
||||
ShowDocLinks = valid;
|
||||
};
|
||||
|
||||
@@ -307,7 +305,17 @@ const DocumentDetails = (props) => {
|
||||
}
|
||||
key={key}
|
||||
onClick={() => {
|
||||
toggleDownLoadLink(key);
|
||||
toggleDownLoadLink(key),
|
||||
sendGAEvent(
|
||||
"event",
|
||||
"DownloadedFile",
|
||||
{
|
||||
caseReference:
|
||||
props.caseReference,
|
||||
filename:
|
||||
detailsObj.pinswg_name,
|
||||
}
|
||||
);
|
||||
}}
|
||||
>
|
||||
<span className="results-visually-hidden">
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
@@ -132,7 +133,19 @@ let CaseSearch = (props) => {
|
||||
/>
|
||||
|
||||
<div className="govuk-form-group">
|
||||
<button type="submit" className="govuk-button">
|
||||
<button
|
||||
type="submit"
|
||||
className="govuk-button"
|
||||
onClick={() => {
|
||||
sendGAEvent(
|
||||
"event",
|
||||
"MyPortalSearchButtonClicked",
|
||||
{
|
||||
searchTerm: basicSearch.value,
|
||||
}
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t("myportal:searchcases-card-button")}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -34,6 +34,8 @@ import {
|
||||
getWatchedCasesProxy,
|
||||
} from "../../actions";
|
||||
|
||||
import { sendGAEvent } from "@next/third-parties/google";
|
||||
|
||||
const SearchResults = (props) => {
|
||||
const {
|
||||
searchString,
|
||||
@@ -261,28 +263,36 @@ const SearchResults = (props) => {
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
setCurrentReference({
|
||||
"ticketnumber":
|
||||
item.ticketnumber,
|
||||
"currentReference":
|
||||
item.title,
|
||||
"currentType":
|
||||
"searchResultsObj",
|
||||
"incidentid":
|
||||
item.incidentid,
|
||||
"appealType":
|
||||
item.pinswg_appealcasetype,
|
||||
"showLoginCheck":
|
||||
props.showLoginCheck,
|
||||
"specialistProcess":
|
||||
detailsObj.pinswg_speacialistcaseprocess !=
|
||||
null ||
|
||||
detailsObj.pinswg_specialistcaseprocess !=
|
||||
null
|
||||
? detailsObj.pinswg_speacialistcaseprocess ||
|
||||
detailsObj.pinswg_specialistcaseprocess
|
||||
: "",
|
||||
});
|
||||
sendGAEvent(
|
||||
"event",
|
||||
"CaseViewed",
|
||||
{
|
||||
caseReference:
|
||||
item.ticketnumber,
|
||||
}
|
||||
),
|
||||
setCurrentReference({
|
||||
"ticketnumber":
|
||||
item.ticketnumber,
|
||||
"currentReference":
|
||||
item.title,
|
||||
"currentType":
|
||||
"searchResultsObj",
|
||||
"incidentid":
|
||||
item.incidentid,
|
||||
"appealType":
|
||||
item.pinswg_appealcasetype,
|
||||
"showLoginCheck":
|
||||
props.showLoginCheck,
|
||||
"specialistProcess":
|
||||
detailsObj.pinswg_speacialistcaseprocess !=
|
||||
null ||
|
||||
detailsObj.pinswg_specialistcaseprocess !=
|
||||
null
|
||||
? detailsObj.pinswg_speacialistcaseprocess ||
|
||||
detailsObj.pinswg_specialistcaseprocess
|
||||
: "",
|
||||
});
|
||||
}}
|
||||
>
|
||||
<span className="results-visually-hidden">
|
||||
|
||||
@@ -1,21 +1,37 @@
|
||||
import Script from "next/script";
|
||||
import React, { Fragment } from "react";
|
||||
import { GoogleTagManager } from "@next/third-parties/google";
|
||||
|
||||
export const Tracking = ({ googleTagManagerID, nonce }) => (
|
||||
<Fragment>
|
||||
<>
|
||||
<Script
|
||||
strategy="afterInteractive"
|
||||
src={`https://www.googletagmanager.com/gtag/js?id=${googleTagManagerID}`}
|
||||
/>
|
||||
<Script
|
||||
id="google-analytics"
|
||||
strategy="afterInteractive"
|
||||
nonce={nonce}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||
})(window,document,'script','dataLayer','${googleTagManagerID}');`,
|
||||
__html: `
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('consent', 'default', {
|
||||
'analytics_storage': 'denied'
|
||||
});
|
||||
|
||||
gtag('config', '${googleTagManagerID}', {
|
||||
page_path: window.location.pathname,
|
||||
});
|
||||
`,
|
||||
}}
|
||||
/>
|
||||
</Fragment>
|
||||
|
||||
{/* <GoogleAnalytics gaId={googleTagManagerID} /> */}
|
||||
|
||||
{/* <GoogleTagManager gtmId={googleTagManagerID} /> */}
|
||||
</>
|
||||
);
|
||||
|
||||
export const TrackingNoScript = ({ googleTagManagerID }) => (
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
"@azure/storage-blob": "^12.17.0",
|
||||
"@azure/storage-queue": "^12.16.0",
|
||||
"@next-auth/prisma-adapter": "^1.0.7",
|
||||
"@next/third-parties": "latest",
|
||||
"@prisma/client": "^5.7.0",
|
||||
"@react-pdf/renderer": "^3.1.14",
|
||||
"@redux-devtools/extension": "^3.3.0",
|
||||
|
||||
Reference in New Issue
Block a user