
## How the Census integration works

Enabling the [Census](https://getcensus.com/) integration for Statsig allows Statsig to receive events from Census. This enables you to ingest data into Statsig from any sources that Census supports.

You can find all events that Statsig receives from Census in the [Metrics](/metrics/introduction) tab in the Statsig console. Statsig automatically includes these events in [Pulse](/experiments/interpreting-results/read-results) and [Experiment](/experiments/monitor) results for your feature gates and experiments respectively.

## Configuring incoming events

1. From the [API Keys](https://console.statsig.com/api_keys) tab in the Statsig console, copy the Statsig “Server Secret Key”.
2. From Census, create a new [destination](https://docs.getcensus.com/destinations/overview) and select Statsig from the list of options.
3. Paste the Statsig secret into the field and click save.

{% figure %}
![Census destination setup form with Statsig secret key input](/images/integrations/data-connectors/census/b3134399-288d-4a0f-b4d2-4b88980f0718.png)
{% /figure %}

4. Create a Sync to the new Statsig destination (refer to the [Sync Configuration](#sync-configuration) section below)
5. On the Statsig [Integrations](https://console.statsig.com/integrations) page, enable the Census integration.

### Sync configuration

You must provide a sync key to uniquely identify each event.

{% figure %}
![Census sync configuration showing sync key selection](/images/integrations/data-connectors/census/e5d1154d-bd55-48d8-a300-13d96a89a0c8.png)
{% /figure %}

Map the following fields to Statsig events.

* `User ID` -> `userID`
* `Event Name` -> `eventName`
* `Timestamp` -> `timestamp`
* `Value` -> `value`

{% figure %}
![Field mapping table aligning Census columns to Statsig event fields](/images/integrations/data-connectors/census/7fce9183-312c-4b47-90c4-b48b0479ecca.png)
{% /figure %}

Statsig includes all other fields in the `metadata` section of the mapped event.

### Custom ID mapping

The Census integration allows the mapping of arbitrary fields to Statsig Custom IDs. To do this, visit the Census panel on the Statsig [Integrations](https://console.statsig.com/integrations) page and look for the "Map Identifier" section. Here you can choose fields you would like mapped to a Custom ID.

{% callout type="note" %}
The input Event Field must match the exact spelling as in the original Census event.
{% /callout %}

{% figure %}
![Statsig integration panel for Census custom ID mapping](/images/integrations/data-connectors/census/213269548-e6457527-c938-44fd-9360-1f3fd7af2fac.png)
{% /figure %}
