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

# Capture button clicks

> Record button clicks and other interactions with the Unify Intent client.

## Overview

Website and product interactions are a strong indicator of a visitor's goal. For
example, a visitor to your marketing website who interacts with a pricing
calculator is much more likely to be an interested buyer than the average
visitor.

In Unify, you capture these types of interactions by sending a custom event when
buttons or website components are clicked. If a visitor is then identified
(e.g., from another form fill or based on company IP matches), their
interactions can be viewed in Unify and used to run plays.

## Prerequisites

* Ensure you've already installed the Unify Intent client on your website.
  See [Set up the Unify Intent client](https://docs.unifygtm.com/developers/guides/website-traffic/unify-intent-client.md)
  for instructions.

## Example

Suppose you have a button that opens your pricing calculator. You can log this
interaction with a custom event that includes useful context as properties.

### Send a custom event

Call `track` when the button is clicked. Include properties that help with
attribution and routing later (e.g., `button_id`, page, placement, or variant).

```ts theme={null}
unify.track('Pricing Calculator Opened', {
  button_id: 'pricing-calculator',
  placement: 'pricing-page-hero',
});
```

### Send multiple custom events

There's no limit on the number of events you can send into Unify, and more data
is always better. You can fire off multiple custom events to capture
interactions at a more granular level.

For example, suppose your pricing calculator contains buttons to select which
pricing plan to view (e.g., "Basic," "Pro," "Enterprise"). You can send an event
each time this button is clicked:

```ts theme={null}
unify.track('Pricing Plan Selected', {
  button_id: 'select-pro-plan',
  plan: 'Pro',
});
```

Suppose that the pricing calculator also contains a slider to select the usage
quantity they expect to use. This information can be sent as well:

```ts theme={null}
unify.track('Pricing Quantity Selected', {
  slider_id: 'usage-quantity',
  credits_needed: '5000',
  plan: 'Pro',
});
```

Now, you can run a play that segments visitors based on what pricing tier they
are most likely to be interested in. Your reps will also know what usage tier
they viewed or selected.

### Identifying the visitor

This example assumes the button click itself does not collect any information
about the visitor, such as name or email address. That's fine—if the visitor is
identified later (e.g., via form fill or IP match), Unify will link this event
to that person or company.

If you *do* have information about the visitor at click time, you should also
send an Identify event. This will immediately link the visitor to the person
or company you specify.

```ts theme={null}
// Send a basic "Identify" event
unify.identify('alice@acme.com');

// Send an "Identify" event with company and person information
unify.identify('alice@acme.com', {
  person: {
    email: 'alice@acme.com',
    first_name: 'Alice',
    last_name: 'Smith',
    title: 'Product Manager',
  },
  company: {
    name: 'Acme Inc.',
    domain: 'acme.com',
  },
});
```

You do not need to send an Identify event on every click. Send it wherever you
first learn the visitor's identity and then subsequent events will be linked
automatically.

## Launch a play

With this custom event in place, you can create plays in Unify that react to
high‑intent clicks like “Pricing Calculator Opened.” For example, a play could:

1. Apply exclusions (competitors, open opportunities, current customers)
2. Launch an AI agent to research the company or person for ICP fit
3. Enroll the person in a follow‑up sequence
4. Prospect more contacts at the same company and enroll them in outreach

## FAQ

> [accordion] What properties should I include?
>
> Include any information that may help you qualify and route interactions,
> such as:
>
> * Button or form identifier
> * Values entered by the visitor
> * Page or component context
> * Variant (for A/B tests)
>
> When in doubt, err on the side of including more properties.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.