use latest openpanel/nextjs package (1.0.0)

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-08-09 23:09:04 +02:00
parent 0069ae60c7
commit ac9cbae138
8 changed files with 29 additions and 76 deletions

View File

@@ -2,15 +2,13 @@ import { cn } from '@/utils/cn';
import type { Metadata } from 'next';
import { Bricolage_Grotesque, Inter } from 'next/font/google';
import { OpenpanelProvider } from '@openpanel/nextjs';
import { OpenPanelComponent } from '@openpanel/nextjs';
import Footer from './footer';
import { defaultMeta } from './meta';
import '@/styles/globals.css';
import Script from 'next/script';
import { Navbar } from './navbar';
export const metadata: Metadata = {
@@ -52,14 +50,11 @@ export default function RootLayout({
<Footer />
</body>
<Script src={'https://openpanel.dev/op1.js'} async defer />
<Script
id="op1"
dangerouslySetInnerHTML={{
__html: `window.op = window.op || function(...args) {(window.op.q = window.op.q || []).push(args)};
window.op('init', {"clientId":"301c6dc1-424c-4bc3-9886-a8beab09b615","sdk":"nextjs","sdkVersion":"1.0.0-beta","trackAttributes":true,"trackScreenViews":true,"trackOutgoingLinks":true});
`,
}}
<OpenPanelComponent
clientId="301c6dc1-424c-4bc3-9886-a8beab09b615"
trackAttributes
trackScreenViews
trackOutgoingLinks
/>
</html>
);