mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 16:45:35 +01:00
add pagetitle to queries
This commit is contained in:
parent
6c302a7325
commit
93650a2f66
9 changed files with 36 additions and 7 deletions
|
|
@ -34,7 +34,7 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
|
|||
|
||||
const { type, payload } = getJsonBody(req);
|
||||
|
||||
const { referrer, eventName, eventData } = payload;
|
||||
const { referrer, eventName, eventData, pageTitle } = payload;
|
||||
let { url } = payload;
|
||||
|
||||
// Validate eventData is JSON
|
||||
|
|
@ -98,12 +98,13 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
|
|||
}
|
||||
|
||||
if (type === 'pageview') {
|
||||
await savePageView({ ...session, url, referrer });
|
||||
await savePageView({ ...session, url, referrer, pageTitle });
|
||||
} else if (type === 'event') {
|
||||
await saveEvent({
|
||||
...session,
|
||||
url,
|
||||
referrer,
|
||||
pageTitle,
|
||||
eventName,
|
||||
eventData,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue