# Usage

### Identifying vistors

The `identify` method is how you tell Bird CRM who the current visitor is. It includes a unique user ID, and any optional attributes you know about them.

You don’t need to call `identify` for anonymous visitors. The SDK automatically assigns them a visitor ID, so tracking events works just fine without having to identify the visitor.&#x20;

{% hint style="info" %}
Make sure to call `identify` as soon as a visitor is identified either as a new user or a returning user.&#x20;
{% endhint %}

To create a new contact with some identifiers, you can call identify as:

```typescript
Bird.contact.identify({
    strategy: 'Visitor', 
    identifier: { 
        key: "emailaddress", value: "michael@example.com" 
    }, 
})
```

By default anonymous visitor events are queued on the client side until the visitor is identified. You can change the behavior in the application's configuration by setting anonymous tracking to the expected behavior.

### Tracking events

To tell Bird CRM about the actions your visitors are performing on your site, you can use the various event tracking methods in the SDK. Every action triggers what’s called an “event”, which can also have associated properties. Here’s a call to track a page view event of an identified visitor,

```typescript
Bird.tracker.web.pageViewed({
    search: "q='bird'",
    title: "Bird co",
    url: "https://bird.com",
    path: "/",
    referrer: "https://google.com"
})
```

That tells Bird CRM that your visitor viewed a specific page with the specified URL. Other events like product viewed may contain more details in the event properties like this:

```typescript
Bird.tracker.ecommerce.productViewed({
    product_image_url: "https://www.bird.com/image.jpg", 
    product_url: "https://www.bird.com/messaging", 
    price: 1
})
```

{% hint style="info" %}
Once you start to track events of identified visitors, you can verify that they are correctly recorded by checking the contact activity timeline on the contact detail page in Bird CRM. These events can be used for segmentation, triggering journeys, and automated flows.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bird.com/api/client-sdks/sdk-integration/web-sdk/usage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
