Add audit analytics and campaign metrics
This commit is contained in:
27
components/public-audit/rybbit-tracking.tsx
Normal file
27
components/public-audit/rybbit-tracking.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import Script from "next/script";
|
||||
|
||||
type RybbitTrackingProps = {
|
||||
domain: string;
|
||||
};
|
||||
|
||||
export function RybbitTracking({ domain }: RybbitTrackingProps) {
|
||||
const siteId = process.env.NEXT_PUBLIC_RYBBIT_SITE_ID?.trim();
|
||||
if (!siteId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const apiUrl = process.env.RYBBIT_API_URL?.trim() || "https://app.rybbit.io";
|
||||
const src = `${apiUrl.replace(/\/$/, "")}/api/script.js`;
|
||||
|
||||
return (
|
||||
<Script
|
||||
async
|
||||
data-site-id={siteId}
|
||||
data-domain={domain}
|
||||
defer
|
||||
id="rybbit-public-audit"
|
||||
src={src}
|
||||
strategy="afterInteractive"
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user