fix(layout): restore ExitIntentDetector and Mautic tracking
Some checks failed
Build and Deploy / build (push) Has been cancelled
Some checks failed
Build and Deploy / build (push) Has been cancelled
This commit is contained in:
@@ -3,7 +3,7 @@ import { NextIntlClientProvider } from "next-intl";
|
|||||||
import { getMessages, setRequestLocale } from "next-intl/server";
|
import { getMessages, setRequestLocale } from "next-intl/server";
|
||||||
import { SUPPORTED_LOCALES, DEFAULT_LOCALE, isValidLocale } from "@/lib/i18n/locales";
|
import { SUPPORTED_LOCALES, DEFAULT_LOCALE, isValidLocale } from "@/lib/i18n/locales";
|
||||||
import Script from "next/script";
|
import Script from "next/script";
|
||||||
import AnalyticsProvider from "@/components/providers/AnalyticsProvider";
|
import ExitIntentDetector from "@/components/home/ExitIntentDetector";
|
||||||
|
|
||||||
const RYBBIT_SITE_ID = process.env.NEXT_PUBLIC_RYBBIT_SITE_ID || "1";
|
const RYBBIT_SITE_ID = process.env.NEXT_PUBLIC_RYBBIT_SITE_ID || "1";
|
||||||
const RYBBIT_HOST = process.env.NEXT_PUBLIC_RYBBIT_HOST || "https://rybbit.nodecrew.me";
|
const RYBBIT_HOST = process.env.NEXT_PUBLIC_RYBBIT_HOST || "https://rybbit.nodecrew.me";
|
||||||
@@ -50,7 +50,19 @@ export default async function LocaleLayout({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AnalyticsProvider clientId={process.env.NEXT_PUBLIC_OPENPANEL_CLIENT_ID || ""} />
|
<Script
|
||||||
|
id="mautic-tracking"
|
||||||
|
strategy="afterInteractive"
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: `
|
||||||
|
(function(w,d,t,u,n,a,m){w['MauticTrackingObject']=n;
|
||||||
|
w[n]=w[n]||function(){(w[n].q=w[n].q||[]).push(arguments)},a=d.createElement(t),
|
||||||
|
m=d.getElementsByTagName(t)[0];a.async=1;a.src=u;m.parentNode.insertBefore(a,m)
|
||||||
|
})(window,document,'script','https://mautic.nodecrew.me/mtc.js','mt');
|
||||||
|
mt('send', 'pageview');
|
||||||
|
`,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<Script
|
<Script
|
||||||
src={`${RYBBIT_HOST}/api/script.js`}
|
src={`${RYBBIT_HOST}/api/script.js`}
|
||||||
data-site-id={RYBBIT_SITE_ID}
|
data-site-id={RYBBIT_SITE_ID}
|
||||||
@@ -58,6 +70,7 @@ export default async function LocaleLayout({
|
|||||||
/>
|
/>
|
||||||
<NextIntlClientProvider messages={messages}>
|
<NextIntlClientProvider messages={messages}>
|
||||||
{children}
|
{children}
|
||||||
|
<ExitIntentDetector />
|
||||||
</NextIntlClientProvider>
|
</NextIntlClientProvider>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user