> ## 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.

# Set up the Unify Intent client

> Send website events directly into Unify with the native SDK.

## Installation

There are multiple ways to install the Unify Intent client depending on your
setup. In most cases, the website tag is the best option to get started.

<CardGroup cols={1}>
  <Card title="Website tag" href="/developers/intent-client/website-tag" icon="code" horizontal>
    Paste a pre-configured JavaScript snippet in your website's HTML. This
    method is the easiest way to get started and is suitable for most websites.
  </Card>
</CardGroup>

<CardGroup cols={2}>
  <Card title="React library" href="/developers/intent-client/react" icon="react" horizontal>
    Install the client in your React web application for a more native
    integration.
  </Card>

  <Card title="JavaScript library" href="/developers/intent-client/js-client" icon="node-js" horizontal>
    Install the client in your non-React frontend application, such as a Single
    Page App (SPA).
  </Card>
</CardGroup>

<Note>
  You should only use one installation method per website or application. If the
  client is installed twice on the same site, it may not work correctly.
</Note>

## Usage

<Tabs>
  <Tab title="Website tag" icon="code">
    ### Automatic events

    Once the website tag is added, it will automatically start collecting
    certain types of events:

    * **Page events**: Every time a visitor loads a page on your website, a page
      view event is sent to Unify. When that visitor is identified, all their
      sessions will be linked to that identity.
    * **Custom events**: Certain button clicks and interactions will be tracked
      automatically. This does not cover all possible interactions, and you will
      likely want to manually trigger events in specific places on your website
      for more complete coverage.
    * **Identify events**: When a visitor fills out a form with their email
      address, they will be automatically identified and linked to that address.
      Other information they fill out (such as first and last name) will not be
      automatically recorded, so you may also want to manually send "identify"
      events on form fills, logins, etc.

    If desired, you can disable automatic event collection by setting specific
    options when initializing the client. See the full [Usage guide](/developers/intent-client/usage-guide)
    for more details.

    ### Manual events

    You can manually trigger events in specific places on your website by
    calling the client directly. When you include the tag in your HTML, you will
    immediately be able to access the client at `window.unify` (or simply
    `unify` since `window` is global).

    #### Page events

    Page events record a page visit. They are fired automatically by default
    when using the website tag, but you can also call them manually.

    ```javascript theme={null}
    // Send a "page" event
    unify.page();
    ```

    #### Custom events

    Custom events record specific actions taken by a visitor, such as button
    clicks or form fills. Some custom events are captured automatically when
    using the website tag, but you can also send custom events manually.

    ```javascript theme={null}
    // Send a basic custom event
    unify.track("See More Button Clicked");

    // Send a custom event with additional properties
    unify.track("Modal Opened", {
      modalName: "Contact Sales Modal"
    });
    ```

    #### Identify events

    Identify events link a visitor to a specific company or person. Basic
    identify events are sent automatically when a visitor fills out a form with
    their email address, but you can also send more detailed identify events
    when you have additional information.

    ```javascript theme={null}
    // Send a basic "identify" event
    unify.identify("user@email.com");

    // Send an "identify" event with additional company or person attributes
    unify.identify("first.last@acme.com", {
      person: {
        email: "first.last@acme.com",
        first_name: "First",
        last_name: "Last",
      },
      company: {
        domain: "acme.com",
        name: "Acme Corp.",
      }
    });
    ```
  </Tab>

  <Tab title="React library" icon="react">
    ### Automatic events

    By default, the React library will not automatically collect any events. You
    can enable automatic event collection when initializing the client. See the
    full [Usage guide](/developers/intent-client/usage-guide) for more details.

    ### Manual events

    You can manually trigger events in specific places in your web application
    by calling the client directly.

    #### Page events

    Page events record a page visit. Typically, the easiest strategy is to
    enable automatic collection of page visits, but you can also call them
    manually.

    ```javascript theme={null}
    // Enable automatic "page" event collection
    unify.startAutoPage();

    // Send a "page" event
    unify.page();
    ```

    #### Custom events

    Custom events record specific actions taken by a visitor, such as button
    clicks or form fills. You can send custom events with arbitrary
    properties anywhere in your React application.

    ```javascript theme={null}
    // Send a basic custom event
    unify.track("See More Button Clicked");

    // Send a custom event with additional properties
    unify.track("Modal Opened", {
      modalName: "Contact Sales Modal"
    });
    ```

    #### Identify events

    Identify events link a visitor to a specific company or person. You can send
    identify events whenever you have information about a visitor, such as their
    name or email address.

    ```javascript theme={null}
    // Send a basic "identify" event
    unify.identify("user@email.com");

    // Send an "identify" event with additional company or person attributes
    unify.identify("first.last@acme.com", {
      person: {
        email: "first.last@acme.com",
        first_name: "First",
        last_name: "Last",
      },
      company: {
        domain: "acme.com",
        name: "Acme Corp.",
      }
    });
    ```
  </Tab>

  <Tab title="JavaScript library" icon="node-js">
    ### Automatic events

    By default, the JavaScript library will not automatically collect any
    events. You can enable automatic event collection when initializing the
    client. See the full [Usage guide](/developers/intent-client/usage-guide)
    for more details.

    ### Manual events

    You can manually trigger events in specific places in your web application
    by calling the client directly.

    #### Page events

    Page events record a page visit. Typically, the easiest strategy is to
    enable automatic collection of page visits, but you can also call them
    manually.

    ```javascript theme={null}
    // Enable automatic "page" event collection
    unify.startAutoPage();

    // Send a "page" event
    unify.page();
    ```

    #### Custom events

    Custom events record specific actions taken by a visitor, such as button
    clicks or form fills. You can send custom events with arbitrary
    properties anywhere in your web application.

    ```javascript theme={null}
    // Send a basic custom event
    unify.track("See More Button Clicked");

    // Send a custom event with additional properties
    unify.track("Modal Opened", {
      modalName: "Contact Sales Modal"
    });
    ```

    #### Identify events

    Identify events link a visitor to a specific company or person. You can send
    identify events whenever you have information about a visitor, such as their
    name or email address.

    ```javascript theme={null}
    // Send a basic "identify" event
    unify.identify("user@email.com");

    // Send an "identify" event with additional company or person attributes
    unify.identify("first.last@acme.com", {
      person: {
        email: "first.last@acme.com",
        first_name: "First",
        last_name: "Last",
      },
      company: {
        domain: "acme.com",
        name: "Acme Corp.",
      }
    });
    ```
  </Tab>
</Tabs>

For complete instructions, see the [Usage guide](/developers/intent-client/usage-guide).
