0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

refactor(console): fix plausible hostname (#5968)

This commit is contained in:
Gao Sun 2024-06-03 11:59:26 +08:00 committed by GitHub
parent 014d7f63c3
commit d498086fdd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -16,6 +16,7 @@ export enum GtagConversionId {
}
export const redditPixelId = 't2_ggt11omdo';
/** The data domain to aggregate the data for Plausible. */
export const plausibleDataDomain = 'logto.io';
const logtoProductionHostname = 'logto.io';

View file

@ -3,7 +3,6 @@ import debug from 'debug';
import { useEffect } from 'react';
import { type RouteObject, useLocation } from 'react-router-dom';
import { plausibleDataDomain } from '@/components/Conversion/utils';
import { getRoutePattern } from '@/utils/route';
const log = debug('usePlausiblePageview');
@ -25,7 +24,7 @@ export const usePlausiblePageview = (routes: RouteObject[], prefix: string) => {
// https://plausible.io/docs/custom-locations#3-specify-a-custom-location
window.plausible?.('pageview', {
u:
appendPath(new URL('https://' + plausibleDataDomain), prefix, routePattern).href +
appendPath(new URL('https://' + window.location.hostname), prefix, routePattern).href +
window.location.search,
});
}, [pathname, prefix, routes]);