Add Rybbit analytics and send click events to it
Docker / build (push) Successful in 1m31s

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
asownerytandClaude Opus 5.5 committed 2026-10-04 15:35:34 +13:00
1 parent 2fff286afb
commit 5be5bda079
2 files changed
+8 -3

No files matched your search

+5
View File
@@ -1,4 +1,5 @@
import localFont from "next/font/local";
import Script from "next/script";
import "./globals.css";
import Navbar from "./components/Navbar";
import Footer from "./components/Footer";
@@ -34,6 +35,10 @@ export default function RootLayout({ children }) {
{children}
<Footer />
<AnalyticsEvents />
<Script
src="https://analytics.cloudrite.co.nz/api/script.js?siteId=362da09a6cea"
strategy="afterInteractive"
/>
</body>
</html>
);
+3 -3
View File
@@ -1,8 +1,8 @@
// Sends a custom event to Plausible if its script is installed; otherwise does nothing.
// Sends a custom event to Rybbit once its script has loaded; otherwise does nothing.
// Events: click_call, click_text, click_email, submit_quote_form, click_google_reviews.
export function trackEvent(name) {
if (typeof window !== "undefined" && typeof window.plausible === "function") {
window.plausible(name);
if (typeof window !== "undefined" && window.rybbit) {
window.rybbit.event(name);
}
}