---
title: Integration first steps
---
# First steps with bitdrift

After you follow the [Quick start guide](../quickstart.md) to successfully integrate the application into bitdrift, this gets you well on your way [to see data](./workflows/overview.md) and begin your bitdrift journey. There are a few things to consider, to make the product more valuable from the start.

# Forward your existing events/logs
## Logging libraries integration
Generally app developers have logging frameworks in place for their app already, and most times these are disabled when the application is released to the public, as those events are not really accessible to the app developer/operator. This is not the case with bitdrift, as we enable
[Recording sessions](../sdk/integrations.md#log-forwarding) back to bitdrift SaaS.

Therefore the recommended approach is to [integrate your logging framework](../sdk/integrations.md#log-forwarding) with bitdrift and ensure those events are collected by the SDK.
If a logging framework is not currently used, we suggest you implement one or use the [Capture SDK log methods](../sdk/features/custom-logs.md) to  and forward the logs via the integration provided in the bitdrift SDK.

## Analytics Event integration
Frequently app operators will have an analytics framework (or several of them) in use through out the app for different purposes. Those events, while they flow into their respective solutions, can also be very valuable when creating [Workflows](workflows/overview.md#what-are-workflows) in bitdrift to capture situations that users face in the app.
We suggest that you emit those events into bitdrift using the [Logger](../sdk/features/custom-logs.md) and labeled approprieately using the [fields](../sdk/features/fields.md#custom-fields) that can be attached to each log message so they can be easily recognized and matched on.

## Registering screen navigation with the bitdrift Logger
bitdrift enables you to register [Screen navigation events](../sdk/features/automatic-instrumentation.md#screen-views) with the product, which then shows them in the [Timeline]() view and gives you the ability to leverage them in [User Journey Diagrams](workflows/actions.md#create-user-journey-diagram) in bitdrift or simply match on them in workflows.

![Screen event examples](../assets/images/first-steps-screen-view-events.png "Screen event examples")

## Labeling events using fields
bitdrift gives you a few different ways to attach metadata to the events that are emitted. The main options available are [Global fields](../sdk/features/fields.md#global-fields) and [Custom fields](../sdk/features/fields.md#custom-fields). Lets see what the differences are and why they are best used.

### Global fields usage
The Global fields construct is generally defined at [SDK Initialization](../sdk/quickstart.md#installation) and those fields will be attached to any event that is emited in the app lifecycle there after. This is extremely useful, when as a developer you want to distinguish different user sessions based on their `user_id`, experiment label, feature flag, etc
As the set of these fields sometimes does need to change throughout the lifecycle of the app, you are also given an option to [add/remove](../sdk/features/fields.md#field-addition-and-removal-methods) fields through the app lifecycle to correctly represent the user state
!!! note ""
    A great example: When the app is open and the SDK is initialized, the user is possibly not yet logged in on first start. When the user successfuly logs in, you can add the `user_id` field to the Global fields

### Custom fields usage
[Custom fields](../sdk/features/fields.md#custom-fields) are only added to the the single event where their value was specified when invoking the [Logger](../sdk/features/custom-logs.md). They can be used used for [matching](workflows/workflow-steps.md#match-conditions) or grouping.

## Formating events -  best practices
When emitting events into the bitdrift SDK, it's highly recommended you make use of [global](#global-fields-usage) or [custom](#custom-fields-usage) fields for metadata instead of putting information into raw log messages. This enables you to use the [custom fields](workflows/workflow-steps.md#custom-fields) in matchers and [Plot charts](workflows/actions.md#plot-charts) for matching and potential [histogram](workflows/actions.md#histogram) or [Average](workflows/actions.md#average) calculation in workflow charts.

When following the above recommendation you can match fields without having to use [regular expression](workflows/workflow-steps.md#match-conditions) matching.
Additionally, you can leverage emiting full JSON payloads into fields and the UI will prettify the data for east of consumption.

# Network integration

It is always recommended you enable the [network integration](../sdk/integrations.md#networking) as this will enable the users to match on network requests and responses and their metadata (succes/failure, response time, response code) in both [match nodes](workflows/workflow-steps.md#matching-rules) and [Plot charts](workflows/actions.md#plot-charts). It will also populate the [`Network` tab](instant-insights/categories.md#network) of the [Instant insights](instant-insights/overview.md#what-are-instant-insights) view.

The instrumenation is supported via a few different ways (`OkHttp` via our gradle plugin on Android and `URLSession` via swizzling on iOS) however there are also manual ways to configure the integration if the app has constraints on the network stack or swizzling is not prefered.

# Tracking/emitting metrics in bitdrift

bitdrift enables you to use [global](#global-fields-usage) or [custom](#custom-fields-usage) fields to attach information to log messages. That can also be metrics that are calculated or measured by the app instance while the users use it.

## Tracking app `Time to Interactive`

The bitdrift SDK enables you to [invoke](../sdk/features/automatic-instrumentation.md#tti) `Logger.AppLaunchTTI()` with the measured Time To Interactive. This will enable you to use that metric in Matchers and Plot charts and automatically populate the [Instant Insights UX](instant-insights/categories.md#ux) chart that displays the histogram of the metric across the whole app population.
