feat: analytics
Signed-off-by: Ameya Shenoy <shenoy.ameya@gmail.com>
This commit is contained in:
parent
cfa3bdf0e3
commit
dabd3c3e68
3 changed files with 20 additions and 0 deletions
|
|
@ -10,6 +10,8 @@ RUN npm ci
|
||||||
# Copy app source code
|
# Copy app source code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
ENV NEXT_PUBLIC_RYBBIT_HOST=https://app.rybbit.io
|
||||||
|
|
||||||
# Build the Next.js app
|
# Build the Next.js app
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,18 @@ import type { NextConfig } from "next";
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
/* config options here */
|
/* config options here */
|
||||||
|
async rewrites() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
source: "/api/script.js",
|
||||||
|
destination: `${process.env.NEXT_PUBLIC_RYBBIT_HOST}/api/script.js`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source: "/api/track",
|
||||||
|
destination: `${process.env.NEXT_PUBLIC_RYBBIT_HOST}/api/track`,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { ThemeProvider } from "@/components/theme-provider";
|
import { ThemeProvider } from "@/components/theme-provider";
|
||||||
import ServiceWorkerManager from "@/components/ServiceWorkerManager";
|
import ServiceWorkerManager from "@/components/ServiceWorkerManager";
|
||||||
|
import Script from "next/script"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Geist,
|
Geist,
|
||||||
|
|
@ -67,6 +68,11 @@ export default function RootLayout({
|
||||||
<GSAPCursor />
|
<GSAPCursor />
|
||||||
<NavigationMenu />
|
<NavigationMenu />
|
||||||
{children}
|
{children}
|
||||||
|
<Script
|
||||||
|
src="/api/script.js"
|
||||||
|
data-site-id="1498"
|
||||||
|
strategy="afterInteractive"
|
||||||
|
/>
|
||||||
<footer className="flex justify-center">
|
<footer className="flex justify-center">
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue