mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-23 02:53:29 +00:00
check for multi-id mode
This commit is contained in:
@@ -76,14 +76,17 @@ async function trackPageView(args: {
|
||||
};
|
||||
|
||||
try {
|
||||
await sendSiteTrackPageViewRequest({
|
||||
apiHost,
|
||||
sitePointer,
|
||||
body: {
|
||||
...sharedTrackedProps,
|
||||
siteSpaceId: sitePointer.siteSpaceId,
|
||||
},
|
||||
});
|
||||
// siteSpaceId is only undefined in mult-id mode (site previews) so we skip the tracking for those
|
||||
if (sitePointer.siteSpaceId) {
|
||||
await sendSiteTrackPageViewRequest({
|
||||
apiHost,
|
||||
sitePointer,
|
||||
body: {
|
||||
...sharedTrackedProps,
|
||||
siteSpaceId: sitePointer.siteSpaceId,
|
||||
},
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to track page view', error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user