mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-18 05:10:45 +00:00
CE-1123 - Update google analytics to work with events as well as page views; add calls to it to most actual pages.
This commit is contained in:
25
src/App.tsx
25
src/App.tsx
@ -49,7 +49,7 @@ import EntityEdit from "qqq/pages/records/edit/RecordEdit";
|
||||
import RecordQuery from "qqq/pages/records/query/RecordQuery";
|
||||
import RecordDeveloperView from "qqq/pages/records/view/RecordDeveloperView";
|
||||
import RecordView from "qqq/pages/records/view/RecordView";
|
||||
import GoogleAnalyticsUtils from "qqq/utils/GoogleAnalyticsUtils";
|
||||
import GoogleAnalyticsUtils, {AnalyticsModel} from "qqq/utils/GoogleAnalyticsUtils";
|
||||
import Client from "qqq/utils/qqq/Client";
|
||||
import ProcessUtils from "qqq/utils/qqq/ProcessUtils";
|
||||
import React, {JSXElementConstructor, Key, ReactElement, useEffect, useState,} from "react";
|
||||
@ -656,7 +656,7 @@ export default function App()
|
||||
},
|
||||
);
|
||||
|
||||
const [pageHeader, setPageHeaderState] = useState("" as string | JSX.Element);
|
||||
const [pageHeader, setPageHeader] = useState("" as string | JSX.Element);
|
||||
const [accentColor, setAccentColor] = useState("#0062FF");
|
||||
const [accentColorLight, setAccentColorLight] = useState("#C0D6F7")
|
||||
const [tableMetaData, setTableMetaData] = useState(null);
|
||||
@ -671,26 +671,9 @@ export default function App()
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
function setPageHeader(header: string | JSX.Element)
|
||||
function recordAnalytics(model: AnalyticsModel)
|
||||
{
|
||||
setPageHeaderState(header);
|
||||
if(typeof header == "string")
|
||||
{
|
||||
recordAnalytics(header)
|
||||
}
|
||||
else
|
||||
{
|
||||
recordAnalytics("Title not available")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
function recordAnalytics(title: string)
|
||||
{
|
||||
googleAnalyticsUtils.recordAnalytics(location, title)
|
||||
googleAnalyticsUtils.recordAnalytics(model)
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user