Skip to content

Full Toolkit for Next-Level Domain Analysis

Instrument more events 📈

Felix Wotschofskya9a6b6a25fb9
diff --git a/app/providers.tsx b/app/providers.tsx
index ab8c4ed..5c22a2f 100644
--- a/app/providers.tsx
+++ b/app/providers.tsx
@@ -16,6 +16,7 @@ const Providers: FC<ProvidersProps> = ({ children }) => (
>
<PlausibleProvider
customDomain="https://insights.wsky.dev"
+ trackOutboundLinks
domain="digger.tools"
>
{children}
diff --git a/components/CopyButton.tsx b/components/CopyButton.tsx
index 4ec02c8..677540d 100644
--- a/components/CopyButton.tsx
+++ b/components/CopyButton.tsx
@@ -1,6 +1,7 @@
'use client';
import { CheckIcon, ClipboardIcon } from 'lucide-react';
+import { usePlausible } from 'next-plausible';
import { type FC, useCallback, useState } from 'react';
import {
@@ -15,12 +16,16 @@ type CopyButton = {
};
const CopyButton: FC<CopyButton> = ({ value }) => {
+ const plausible = usePlausible();
+
const [wasCopied, setWasCopied] = useState(false);
const copy = useCallback(() => {
setWasCopied(true);
navigator.clipboard.writeText(value);
setTimeout(() => setWasCopied(false), 2000);
- }, [value, setWasCopied]);
+
+ plausible('Copy Button: Click', { props: { value } });
+ }, [value, setWasCopied, plausible]);
if (wasCopied) {
return <CheckIcon className="mx-1 inline-block h-4 w-4 -translate-y-0.5" />;
diff --git a/components/IpLink.tsx b/components/IpLink.tsx
index cb6e859..f04c960 100644
--- a/components/IpLink.tsx
+++ b/components/IpLink.tsx
@@ -1,6 +1,7 @@
'use client';
import { InfoIcon } from 'lucide-react';
+import { usePlausible } from 'next-plausible';
import { type FC, useCallback, useState } from 'react';
import {
@@ -17,8 +18,13 @@ type IpLinkProps = {
};
const IpLink: FC<IpLinkProps> = ({ value }) => {
+ const plausible = usePlausible();
+
const [isOpen, setOpen] = useState(false);
- const open = useCallback(() => setOpen(true), [setOpen]);
+ const open = useCallback(() => {
+ setOpen(true);
+ plausible('IP Details: Open', { props: { ip: value } });
+ }, [setOpen, plausible, value]);
return (
<>
diff --git a/components/LocationSelector.tsx b/components/LocationSelector.tsx
index 91c5873..2433e99 100644
--- a/components/LocationSelector.tsx
+++ b/components/LocationSelector.tsx
@@ -1,5 +1,6 @@
'use client';
+import { usePlausible } from 'next-plausible';
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
import { FC, useCallback } from 'react';
@@ -22,6 +23,8 @@ const LocationSelector: FC<LocationSelectorProps> = ({
initialValue,
disabled,
}) => {
+ const plausible = usePlausible();
+
const router = useRouter();
const pathname = usePathname();
const searchParams = useSearchParams();
@@ -38,8 +41,12 @@ const LocationSelector: FC<LocationSelectorProps> = ({
const search = current.size ? `?${current.toString()}` : '';
router.push(`${pathname}${search}`);
+
+ plausible('Location Selector: Change', {
+ props: { location: value },
+ });
},
- [router, pathname, searchParams]
+ [router, pathname, searchParams, plausible]
);
return (
diff --git a/components/ResolverSelector.tsx b/components/ResolverSelector.tsx
index a2fc754..8c6b39f 100644
--- a/components/ResolverSelector.tsx
+++ b/components/ResolverSelector.tsx
@@ -1,5 +1,6 @@
'use client';
+import { usePlausible } from 'next-plausible';
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
import { FC, useCallback } from 'react';
@@ -16,6 +17,8 @@ type ResolverSelectorProps = {
};
const ResolverSelector: FC<ResolverSelectorProps> = ({ initialValue }) => {
+ const plausible = usePlausible();
+
const router = useRouter();
const pathname = usePathname();
const searchParams = useSearchParams();
@@ -32,8 +35,12 @@ const ResolverSelector: FC<ResolverSelectorProps> = ({ initialValue }) => {
const search = current.size ? `?${current.toString()}` : '';
router.push(`${pathname}${search}`);
+
+ plausible('Resolver Selector: Change', {
+ props: { resolver: value },
+ });
},
- [router, pathname, searchParams]
+ [router, pathname, searchParams, plausible]
);
return (
diff --git a/components/SearchForm.tsx b/components/SearchForm.tsx
index 66e28e9..74852d5 100644
--- a/components/SearchForm.tsx
+++ b/components/SearchForm.tsx
@@ -1,6 +1,7 @@
'use client';
import { Loader2 } from 'lucide-react';
+import { usePlausible } from 'next-plausible';
import { usePathname, useRouter } from 'next/navigation';
import { toASCII } from 'punycode';
import { ChangeEvent, FormEvent, useEffect, useState } from 'react';
@@ -23,6 +24,8 @@ type SearchFormProps = {
};
const SearchForm = (props: SearchFormProps) => {
+ const plausible = usePlausible();
+
const router = useRouter();
const pathname = usePathname();
@@ -67,6 +70,10 @@ const SearchForm = (props: SearchFormProps) => {
}
router.push(target);
+
+ plausible('Search Form: Submit', {
+ props: { domain: normalizedDomain },
+ });
};
return (