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.

Make sure to call identify as soon as a visitor is identified either as a new user or a returning user.

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

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,

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:

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

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.

Last updated