Skip to content

Commit

Permalink
feat: add analytic events (#397)
Browse files Browse the repository at this point in the history
* feat: add analytic events

* add goto-certsho-overview event
  • Loading branch information
maaaathis authored Oct 30, 2024
1 parent 894f87b commit 0501562
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ const IpOverviewItem: FC<IpOverviewItemProps> = ({
<>
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild onClick={open}>
<TooltipTrigger
asChild
onClick={open}
data-umami-event="modal-ipoverview"
>
<div className="flex cursor-pointer select-none flex-row gap-2 rounded-lg p-2 px-2.5 pr-3 hover:bg-accent">
<Dot className="my-auto inline-block h-7 w-7 shrink-0" />
<div className="flex flex-col">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const TechnologiesWidget: React.FC<Props> = async ({
return (
<TooltipProvider key={technology.index}>
<Tooltip>
<TooltipTrigger asChild>
<TooltipTrigger asChild data-umami-event="modal-technologies">
<Link
href={
filterWhatRunsDirectUrl(technology.website) ??
Expand Down
1 change: 1 addition & 0 deletions app/lookup/[domain]/_components/ShareButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const ShareButton: FC = () => {
variant="secondary"
className="flex h-6 shrink-0 flex-row gap-2 rounded-lg p-2 text-xs"
onClick={handleShareCall}
data-umami-event="share"
>
{isCopied ? (
<>
Expand Down
6 changes: 5 additions & 1 deletion app/lookup/[domain]/certs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ const CertsResultsPage: FC<CertsResultsPageProps> = async ({
<TableCell className="pr-0">
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<TooltipTrigger
asChild
data-umami-event="goto-certsh-details"
>
<Link
href={`https://crt.sh/?id=${cert.id}`}
target="_blank"
Expand Down Expand Up @@ -192,6 +195,7 @@ const CertsResultsPage: FC<CertsResultsPageProps> = async ({
}
target="_blank"
rel="noreferrer noopener"
data-umami-event="goto-certsh-overview"
className="cursor-pointer select-none decoration-slate-700 decoration-dotted underline-offset-4 hover:underline dark:decoration-slate-300"
>
Sectigo&apos;s crt.sh
Expand Down
6 changes: 5 additions & 1 deletion app/lookup/[domain]/dns/_components/DnsHistoryButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ export const DnsHistoryButton: FC<Props> = (props) => {
rel="noopener nofollow"
className="my-auto"
>
<Button variant="outline" className="rounded-lg text-sm font-medium">
<Button
variant="outline"
className="rounded-lg text-sm font-medium"
data-umami-event="goto-dnshistory"
>
DNS History
<ExternalLink className="ml-2 h-3 w-3" />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ export const FlushCloudflareDnsCacheButton: FC = () => {
rel="noopener"
className="my-auto"
>
<Button variant="outline" className="rounded-lg text-sm font-medium">
<Button
variant="outline"
className="rounded-lg text-sm font-medium"
data-umami-event="goto-flush-cloudflare"
>
Flush Cloudflare DNS Cache
<ExternalLink className="ml-2 h-3 w-3" />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ export const FlushGoogleDnsCacheButton: FC = () => {
rel="noopener"
className="my-auto"
>
<Button variant="outline" className="rounded-lg text-sm font-medium">
<Button
variant="outline"
className="rounded-lg text-sm font-medium"
data-umami-event="goto-flush-googledns"
>
Flush Google DNS Cache
<ExternalLink className="ml-2 h-3 w-3" />
</Button>
Expand Down
6 changes: 5 additions & 1 deletion app/lookup/[domain]/dns/_components/IpLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ const IpLink: FC<IpLinkProps> = ({ value }): ReactElement => {
<>
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild onClick={open}>
<TooltipTrigger
asChild
onClick={open}
data-umami-event="modal-iplink"
>
<a className="cursor-pointer select-none underline decoration-dotted underline-offset-4 hover:decoration-dashed">
<span className="select-none">{value}</span>
<InfoIcon
Expand Down
2 changes: 1 addition & 1 deletion components/CopyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const CopyButton: FC<CopyButton> = ({ value }): ReactElement => {
return (
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<TooltipTrigger asChild data-umami-event="copied-value">
<ClipboardIcon
role="button"
className="mx-1 inline-block h-4 w-4 -translate-y-0.5 cursor-pointer"
Expand Down
3 changes: 3 additions & 0 deletions components/ThemeToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default function ThemeToggle() {
size="icon"
className="w-full rounded-2xl"
onClick={() => setTheme('dark')}
data-umami-event="theme-select-dark"
>
<Moon className="h-5 w-5" />
</Button>
Expand All @@ -37,6 +38,7 @@ export default function ThemeToggle() {
size="icon"
className="w-full rounded-2xl"
onClick={() => setTheme('light')}
data-umami-event="theme-select-light"
>
<Sun className="h-5 w-5" />
</Button>
Expand All @@ -45,6 +47,7 @@ export default function ThemeToggle() {
size="icon"
className="w-full rounded-2xl"
onClick={() => setTheme('system')}
data-umami-event="theme-select-auto"
>
<Monitor className="h-5 w-5" />
</Button>
Expand Down

1 comment on commit 0501562

@vercel
Copy link

@vercel vercel bot commented on 0501562 Oct 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.