> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flagsync.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Events

> Track user actions in FlagSync to measure feature impact.

## Sending Events

Events track user actions like clicks, sign-ups, or purchases.

In this third step, we’ll track two events for the `new-feature` flag (from [Quickstart: Set Up a Flag](/quickstarts/flag)) to test if the new layout boosts conversions in an experiment.

* `Sign-Up CTA Click` (sign-up clicks within the layout (`Disabled` / `Enabled`)
* `Sign-Up Complete` (completed sign-ups).

<Steps>
  <Step title="Check SDK Setup">
    Ensure the SDK is initialized (from [Quickstart: Integrate the SDK](/quickstarts/sdk)):

    ```typescript theme={null}
    import { FlagSyncFactory } from '@flagsync/js-sdk';

    const factory = FlagSyncFactory({
      sdkKey: 'your-sdk-key',
      core: {
        key: 'userId_0x123'
      }
    });

    const client = factory.client();
    await client.waitForReady();
    ```
  </Step>

  <Step title="Track CTA Clicks">
    Add a `track()` call when users click the CTA:

    <CodeGroup>
      ```tsx React theme={null}
      <Button id="signup-btn" onClick{() => {
        client.track('signup-cta-click')
        router.push('/signup')
      }}>
        Sign Up
      </Button>
      ```

      ```javascript Vanilla JS theme={null}
      document
        .getElementById('signup-btn')
        .addEventListener('click', () => {
          client.track('signup-cta-click');
        });
      ```
    </CodeGroup>
  </Step>

  <Step title="Track Sign-Ups">
    Log when users complete registration:

    ```typescript theme={null}
    function onSignUpComplete() {
      client.track('signup-complete');
    }
    ```
  </Step>

  <Step title="Verify in Dashboard">
    * In the Dashboard, Click "+" next to **Metrics** or go to [Create a Metric](https://www.flagsync.com/dashboard/metrics/new/).
    * Check that `signup-cta-click` and `signup-complete` appear in the "Select Event" dropdown—they’ll auto-populate from these track calls.
    * You also also watch [Live Events](https://www.flagsync.com/dashboard/events/) from the Dashboard.
  </Step>
</Steps>

## Next Steps

Events are flowing—now use them:

* Define metrics in [Quickstart: Define Metrics](/quickstarts/metrics).
* Learn more in [Events](/events/overview).
