MCPcopy Create free account
hub / github.com/dailydotdev/apps / getAdPageViewId

Function getAdPageViewId

packages/shared/src/features/monetization/adPageView.ts:19–31  ·  view source on GitHub ↗
(path?: string)

Source from the content-addressed store, hash-verified

17};
18
19export const getAdPageViewId = (path?: string): string | undefined => {
20 if (typeof window === 'undefined') {
21 return undefined;
22 }
23
24 const url = new URL(path ?? window.location.href, window.location.origin);
25 const entry = `${getHistoryEntryKey()}:${url.pathname}${url.search}`;
26 if (pageView?.entry !== entry) {
27 pageView = { entry, id: generatePageViewId() };
28 }
29
30 return pageView.id;
31};

Callers 3

fetchAdRequestFunction · 0.90
adPageView.spec.tsFile · 0.90
useAdPageViewIdFunction · 0.90

Calls 2

generatePageViewIdFunction · 0.85
getHistoryEntryKeyFunction · 0.70

Tested by

no test coverage detected