refactor(LOY-48): add signup specific content page tracking
This commit is contained in:
committed by
Chuma Mcphoy (We Ahead)
parent
a6f14e09cf
commit
ea27bb01e2
@@ -1,6 +1,5 @@
|
||||
import { metrics } from "@opentelemetry/api"
|
||||
|
||||
import { Lang } from "@/constants/languages"
|
||||
import { batchRequest } from "@/lib/graphql/batchRequest"
|
||||
import {
|
||||
GetContentPageBlocksRefs,
|
||||
@@ -12,12 +11,14 @@ import { generateTag, generateTagsFromSystem } from "@/utils/generateTag"
|
||||
|
||||
import { contentPageRefsSchema } from "./output"
|
||||
|
||||
import { TrackingChannelEnum } from "@/types/components/tracking"
|
||||
import { ContentPageEnum } from "@/types/enums/contentPage"
|
||||
import { System } from "@/types/requests/system"
|
||||
import {
|
||||
import type { System } from "@/types/requests/system"
|
||||
import type {
|
||||
ContentPageRefs,
|
||||
GetContentPageRefsSchema,
|
||||
} from "@/types/trpc/routers/contentstack/contentPage"
|
||||
import type { Lang } from "@/constants/languages"
|
||||
|
||||
const meter = metrics.getMeter("trpc.contentPage")
|
||||
// OpenTelemetry metrics: ContentPage
|
||||
@@ -224,3 +225,27 @@ export function getConnections({ content_page }: ContentPageRefs) {
|
||||
}
|
||||
return connections
|
||||
}
|
||||
|
||||
const signupContentPageUid = "blt0e6bd6c4d7224f07"
|
||||
const signupVerifyContentPageUid = "blt3247a2a29b34a8e8"
|
||||
|
||||
export function createPageType(uid: string): string {
|
||||
switch (uid) {
|
||||
case signupContentPageUid:
|
||||
return "memberprofilecreatepage"
|
||||
case signupVerifyContentPageUid:
|
||||
return "memberprofilecreatesuccesspage"
|
||||
default:
|
||||
return "staticcontentpage"
|
||||
}
|
||||
}
|
||||
|
||||
export function createChannel(uid: string): TrackingChannelEnum {
|
||||
switch (uid) {
|
||||
case signupContentPageUid:
|
||||
case signupVerifyContentPageUid:
|
||||
return TrackingChannelEnum["scandic-friends"]
|
||||
default:
|
||||
return TrackingChannelEnum["static-content-page"]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user