feat: add tracking events for loyalty pages

This commit is contained in:
Christel Westerberg
2024-07-11 10:12:46 +02:00
parent 127df6ab90
commit a8a67d5e35
7 changed files with 186 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
import { serverClient } from "@/lib/trpc/server"
import TrackingSDK from "@/components/Current/TrackingSDK"
import { Blocks } from "@/components/Loyalty/Blocks"
import Sidebar from "@/components/Loyalty/Sidebar"
import MaxWidth from "@/components/MaxWidth"
@@ -14,6 +15,10 @@ export default async function LoyaltyPage({ lang }: LangParams) {
if (!loyaltyPage) {
return null
}
const loyaltyPageTracking =
await serverClient().contentstack.loyaltyPage.tracking()
return (
<section className={styles.content}>
{loyaltyPage.sidebar.length ? (
@@ -26,6 +31,7 @@ export default async function LoyaltyPage({ lang }: LangParams) {
<Blocks blocks={loyaltyPage.blocks} lang={lang} />
) : null}
</MaxWidth>
<TrackingSDK pageData={loyaltyPageTracking} />
</section>
)
}