Tracking
Gatsby custom events
Send custom events from a Gatsby app with @nextanalytica/tag: sign-ups, demo requests and conversions your agent reads by channel.
Updated
In Gatsby, send custom events with track from @nextanalytica/tag in a component's event handler. The Gatsby plugin adds the tag and counts page changes; track adds your own events.
How does it look?
src/components/SignupButton.tsx
import * as React from "react";
import { track } from "@nextanalytica/tag";
export function SignupButton() {
return <button onClick={() => track("signup_started", { plan: "team" })}>Start free</button>;
}What can you ask your agent?
- "Which events happen most this week?"
- "What's the sign-up rate by channel this month?"