A Simple API for Tracking Any Event

    A Simple API for Tracking Any Event

    Create an aggregator, send your first events, and get useful summaries without installing an SDK.

    Most teams do not need another analytics project. They need a low-friction way to answer questions like:

    • Did signups run today?
    • Did the nightly import finish?
    • How many checkouts happened after the campaign went live?
    • Which operational events should the team notice before tomorrow?

    Eventkiwi is built around that smaller, practical workflow. You create an aggregator, send events to it with a simple HTTP request, and receive scheduled summaries instead of wiring a full dashboard stack before you know what you need.

    The model: one aggregator, many events

    An aggregator is the container that receives related events. In the Eventkiwi dashboard, create an aggregator for the workflow you want to monitor: product signups, billing events, import jobs, operational checks, or anything else that emits countable signals.

    Each aggregator gives you:

    • An aggregator ID, passed as _id
    • A reporting schedule, such as daily, weekly, or monthly
    • A place for Eventkiwi to group incoming events into summaries

    After that, every event only needs a name. Extra fields can be used as tags when you want the report to break counts down by useful dimensions.

    Send the first event with GET

    For a quick test, a GET request is the fastest path. Replace the placeholders with the aggregator ID and API key from your account.

    curl "https://app.eventkiwi.com/api/event?_id=YOUR_AGGREGATOR_ID&_apikey=YOUR_API_KEY&name=user_signup"
    

    That is enough to record one user_signup event.

    GET is useful for smoke tests, scripts, and simple integrations. For production application code, prefer POST with a Bearer token so credentials stay out of URLs and logs.

    Send production events with POST

    Here is the same event using POST:

    curl -X POST "https://app.eventkiwi.com/api/event?_id=YOUR_AGGREGATOR_ID" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"name":"user_signup"}'
    

    If the event is accepted, Eventkiwi returns a small success response:

    {
      "status": "ok"
    }
    

    You can put that request anywhere your application already knows that something happened: after account creation, after checkout, when a background job completes, or when an operational check changes state.

    A tiny JavaScript helper

    Most applications only need a small wrapper around fetch:

    const EVENTKIWI_AGGREGATOR_ID = process.env.EVENTKIWI_AGGREGATOR_ID;
    const EVENTKIWI_API_KEY = process.env.EVENTKIWI_API_KEY;
    
    export async function trackEvent(name: string, tags: Record<string, boolean> = {}) {
      if (!EVENTKIWI_AGGREGATOR_ID || !EVENTKIWI_API_KEY) {
        return;
      }
    
      await fetch(
        `https://app.eventkiwi.com/api/event?_id=${EVENTKIWI_AGGREGATOR_ID}`,
        {
          method: "POST",
          headers: {
            Authorization: `Bearer ${EVENTKIWI_API_KEY}`,
            "Content-Type": "application/json",
          },
          body: JSON.stringify({ name, ...tags }),
        }
      );
    }
    

    Then call it from the code paths that matter:

    await trackEvent("user_signup", {
      "env-production": true,
      "platform-web": true,
    });
    
    await trackEvent("checkout_completed", {
      "env-production": true,
      "plan-premium": true,
    });
    
    await trackEvent("import_completed", {
      "env-production": true,
      "source-stripe": true,
    });
    

    Keep tags simple

    Tags are intentionally lightweight. Eventkiwi counts tag keys, not tag values. That means region=us and region=eu are both counted as the same region tag.

    When you need a value to appear separately in reports, encode it in the tag key:

    curl "https://app.eventkiwi.com/api/event?_id=YOUR_AGGREGATOR_ID&_apikey=YOUR_API_KEY&name=checkout_completed&plan-premium&env-production"
    

    This records one checkout_completed event with plan-premium and env-production tags.

    Use tags for dimensions you will actually act on. A few stable tags make summaries readable. Hundreds of unique tags make reports noisy.

    What to track first

    Start with events that someone would care about in a daily or weekly summary:

    • user_signup
    • checkout_completed
    • trial_started
    • api_error
    • job_completed
    • backup_created
    • integration_failed

    The best first aggregator is usually not "all analytics." It is one operational or product loop where a concise summary would save someone from checking logs, refreshing a dashboard, or asking for a manual status update.

    Create the aggregator, send a handful of events, and let the first report show you what is worth instrumenting next.