Customer.io Destination Config Reference
- free
- growth
- enterprise
11 minute read
Customer.io is a messaging and marketing automation destination. RudderStack sends events to Customer.io’s APIs from its servers, or through Customer.io’s own SDKs in device mode on web, Android, and iOS.
In a Customer.io destination spec:
type: customeriodefinition_version: 1
Sample configuration
version: rudder/v1
kind: destination
metadata:
name: customerio-prod
spec:
id: customerio-prod
display_name: Customer.io Production
type: customerio
definition_version: 1
enabled: true
config:
site_id: "{{ .CUSTOMERIO_SITE_ID }}"
api_key: "{{ .CUSTOMERIO_API_KEY }}"
datacenter: US
api_version: v2
user_id_identifier_type: id
device_token_event_name: Device Token Registered
sdk_version:
web: v2
write_key:
web: "{{ .CUSTOMERIO_WRITE_KEY }}"
anonymous_in_app:
web: false
send_page_name_in_sdk:
web: true
auto_track_device_attributes:
android: true
ios: true
background_queue_min_number_of_tasks:
android: "10"
background_queue_seconds_delay:
android: "30"
connection_mode:
web: device
android: device
cloud: cloud
consent_management:
web:
- provider: oneTrust
consents:
- marketingThe above example sends server-side events through the v2 API, and connects web and Android sources in device mode, where the SDK settings apply. Web loads the v2 JavaScript client, so it needs write_key — see Key dependencies.
Config keys
config accepts only the keys listed below. The shared config key rules cover unknown keys, defaults, and immutability.
Key dependencies
Which credentials Customer.io needs depends on the modes your sources connect in, and on the web SDK version. Rudder CLI enforces each requirement below.
| Key | Required when |
|---|---|
api_key | Always, unless web is the only source type and connects in device mode. Also checked per connection — see Connect a source. |
site_id | Always, unless web is the only source type and connects in device mode with sdk_version.web set to v2. Also checked per connection. |
write_key | connection_mode.web is device and sdk_version.web is v2 |
user_id_identifier_type | api_version is v2, including when it’s omitted |
Writesdk_versionout to use the v2 web client. When the block is omitted, nothing fills it in — the destination is stored without a version, which Customer.io’s web SDK and the API’s checks both read asv1. Thev2default applies only inside ansdk_versionblock you write.
Connection
site_id
RequiredSecretType:
string
Description: Your Customer.io site ID.
Notes:
- Required unless
webis the only source type and connects indevicemode withsdk_version.webset tov2. See Key dependencies. - At most 100 characters, and must not contain line breaks.
- A
{{ path || fallback }}template is accepted in place of a literal.
api_key
RequiredSecretType:
string
Description:
Your Customer.io Tracking API key, paired with site_id.
Notes:
- Required unless
webis the only source type and connects indevicemode. - At most 100 characters, and must not contain line breaks.
- A
{{ path || fallback }}template is accepted in place of a literal.
{{ .VAR }} reference rather than a literal — see Secrets.datacenter
RequiredType:
string
Description: Region of your Customer.io account.
Notes:
USorEU.- The dashboard defaults this field to
US. Rudder CLI requires it explicitly. - A spec that omits this key fails validation.
device_token_event_name
Type:
string
Description: Name of the event your app fires right after it sets the device token, so RudderStack can send the token to Customer.io immediately. Applies in both modes.
Notes:
- At most 100 characters, and must not contain line breaks.
- A
{{ path || fallback }}template is accepted in place of a literal.
Cloud mode
These keys apply to events sent in cloud mode. They have no effect on device-mode delivery.
api_version
Type:
string
Default value:
v2
Description: Customer.io API that delivers cloud-mode events.
Notes:
v2— Customer.io’s unified batch API. Needsuser_id_identifier_type.v1— Customer.io’s per-endpoint APIs.- Omitting this key is the same as setting
v2.
user_id_identifier_type
RequiredType:
string
Description:
Customer.io identifier that receives the RudderStack userId.
Notes:
- Required when
api_versionisv2— including when you omitapi_version, sincev2is the default. Leave it unset only withv1. - One of
id,email,phone, orcio_id. Withphone, the value must read as E.164 — for example+15551234567.
userIdis sent as this identifier for every event, with no fallback — chooseidand send an email address, and it’s sent as an ID. A wrong choice attaches events to the wrong profiles or creates new ones, and that can’t be reversed. Withv2, events without auserIdfail.
Device mode
These keys configure Customer.io’s SDKs, so they apply only to sources connected in device mode. Each is keyed by the source type it applies to.
sdk_version
Type:
object
Description:
Customer.io JavaScript client that web device mode loads. v1 loads the legacy snippet and uses site_id. v2 loads the Data Pipelines JavaScript client and needs write_key. Switching an existing destination to v2 changes where your web events land.
Notes:
web—v1orv2. Defaults tov2, but only inside ansdk_versionblock you write — an omitted block is read asv1.- Applies when
connection_mode.webisdevice.
sdk_version:
web: v2write_key
RequiredType:
object
Description:
Write key of your Customer.io Data Pipelines JavaScript source. On v2, web events go to this source instead of the Track API.
Notes:
web— string. Required whenconnection_mode.webisdeviceandsdk_version.webisv2.- At most 100 characters, and must not contain line breaks. A
{{ path || fallback }}template is measured as literal text against the same limit.
anonymous_in_app
Type:
object
Description:
Show in-app messages to website visitors you haven’t identified yet. Needs in-app messaging turned on in your Customer.io workspace, and a Customer.io plan that supports anonymous in-app messages. In-app messages for identified users need no setting on v2.
Notes:
web— boolean. The dashboard defaults it tofalse.- Applies when
sdk_version.webisv2. Rudder CLI also accepts it withv1, where it has no effect.
send_page_name_in_sdk
Type:
object
Description:
Send the page name to Customer.io. When false, Customer.io records the page URL instead.
Notes:
web— boolean. The dashboard defaults it totrue; Rudder CLI doesn’t fill it in.
data_use_in_app
Type:
object
Description: Enable Customer.io in-app messages on your website.
Notes:
web— boolean. The dashboard defaults it tofalse.- Applies to the
v1web client. Rudder CLI also accepts it withv2, where it has no effect.
auto_track_device_attributes
Type:
object
Description:
Let Customer.io’s mobile SDK track device attributes automatically. Set false to track them yourself.
Notes:
android,ios— booleans. The dashboard defaults both totrue; Rudder CLI doesn’t fill them in.
auto_track_device_attributes:
android: true
ios: falsebackground_queue_min_number_of_tasks
Type:
object
Description: Minimum number of tasks the Android SDK keeps in its background queue.
Notes:
android— a whole number written as a string,"10"rather than10. At most 100 characters, or a template.- The dashboard defaults it to
"10"; Rudder CLI doesn’t fill it in.
background_queue_seconds_delay
Type:
object
Description: Delay, in seconds, that the Android SDK holds events in its background queue.
Notes:
android— a whole number written as a string,"30"rather than30. At most 100 characters, or a template.- The dashboard defaults it to
"30"; Rudder CLI doesn’t fill it in.
Event filtering
Client-side event filtering applies only whenconnection_mode.webisdevice— the dashboard shows these controls only then, and the SDK is what applies the filter. Rudder CLI accepts the block in any mode, but it has no effect on other connections.
event_filtering
Type:
object
Description:
Restricts which track events the web SDK passes to Customer.io, by event name.
Notes:
- Applies when
connection_mode.webisdevice. Leave it unset otherwise. whitelist— array of event names to allow; every othertrackevent is dropped.blacklist— array of event names to drop; every othertrackevent is allowed.- The two are mutually exclusive, and Rudder CLI enforces it — setting both fails validation.
- Each name is at most 100 characters, or a
{{ path || fallback }}template.
Per-source keys
Both keys are objects keyed by the local source type — the tokens listed under Source types. A key naming a source type this destination doesn’t support fails validation.
connection_mode
Type:
object
Description: Maps each source type you connect to the mode its events reach Customer.io in, using the modes in Source types.
Notes:
- An entry is required for each source type you connect — see Connect a source.
- A mode the source type doesn’t support on this destination fails validation — for example
deviceforandroid_kotlin.
connection_mode:
web: device
android: device
ios: cloudconsent_management
Type:
object
Description:
Consent provider configuration per source type. The entry shape, accepted providers, and the rules on resolution_strategy and consents are shared across all destination types — see Consent management.
Source types
Customer.io accepts events from these source types in the mentioned connection modes:
| Source type | Connection mode |
|---|---|
android | cloud, device |
android_kotlin | cloud |
ios | cloud, device |
ios_swift | cloud |
web | cloud, device |
unity | cloud |
cloud | cloud |
react_native | cloud |
flutter | cloud |
cordova | cloud |
warehouse | cloud |
web, android, and ios offer device mode. The Kotlin and Swift SDKs — android_kotlin and ios_swift — are cloud only. See Customer.io device mode.
warehouse is the token a Reverse ETL source resolves to. Rudder CLI manages the destination’s warehouse entry — if the destination is connected to a Reverse ETL source, set connection_mode.warehouse: cloud in its spec, or apply removes it.
Rudder CLI can also declare the Reverse ETL connection itself, for the types listed under Supported destinations — see Manage Reverse ETL Connections using Rudder CLI.
Important considerations
- Rudder CLI cannot declare a Reverse ETL connection to Customer.io — it syncs Reverse ETL data through its own flow, which connection specs can’t express. The
warehouseentry still belongs in the spec so thatapplykeeps a connection you set up in the dashboard.- The dashboard additionally offers Customer.io to AMP and Shopify sources. Rudder CLI doesn’t manage those connections, so
ampandshopifyare invalid here.
Connect a source
An event stream connection to this destination is checked against three rules at validate time.
The source’s type must be supported. A source’s type resolves to one of the tokens above before the check — a JavaScript source resolves to web, and webhook and server-side SDK sources resolve to cloud. Every type an event stream source can resolve to is supported here, so this check always passes.
The destination config must carry a connection_mode entry for that source type. This lives on the destination spec, not on the connection spec. Without it:
destination 'customerio-prod' config has no 'connection_mode' entry for source type 'web'Every source needs api_key and site_id, except web connecting in device mode. Without them:
destination 'customerio-prod' config is missing fields required to connect a 'cloud' source: api_key, site_idWhat web needs in device mode depends on the other source types and on sdk_version — see Key dependencies.
Secrets
api_key and site_id are the secret keys. Write each as a {{ .VAR }} reference and supply the value at apply time:
config:
site_id: "{{ .CUSTOMERIO_SITE_ID }}"
api_key: "{{ .CUSTOMERIO_API_KEY }}"export RUDDER_CUSTOMERIO_SITE_ID="..."
export RUDDER_CUSTOMERIO_API_KEY="..."
rudder-cli apply
# or
rudder-cli apply --var-file secrets.vars.yamlNote that:
rudder-cli importwrites only the secrets the API returns, as{{ .VAR }}references, and leaves the others out. Add any secret key it leaves out, then supply the variables before you apply — see Secrets.- In web device mode the site ID (
v1) orwrite_key(v2) is embedded in the page’s JavaScript, so neither value is hidden from a visitor. Maskingsite_idprotects your YAML, not the value itself.write_keyisn’t a secret key, soimportwrites it as a literal.
See How to Use Variable Substitution in Rudder CLI.
Changes by release
| Version | Change |
|---|---|
| v0.29.0 | Breaking: A null config value, written as key: null, key: ~, or key: with no value, fails validate with '<key>' must not be null; set a value or remove the key. Earlier releases accepted it: a top-level null planned an update on every apply, and a null inside a list item failed at the API.What to do: Remove the key to leave it unset, or give it a value. |
| v0.29.0 | Breaking: An empty string, "", on a key that takes one of a fixed set of values fails validate with '<key>' must be one of [...], unless "" is one of the key’s values. Earlier releases accepted it, and the API rejected it at apply.What to do: Remove the key to leave it unset, or set one of the listed values. |
| v0.29.0 | Changed: validate warns when a secret key holds anything but one {{ .VAR }} reference with no default, and when one variable fills two secret keys. It also masks secret values in the lines it prints. |
| v0.29.0 | Changed: rudder-cli import writes each secret reference single-quoted, as '{{ .VAR }}', so a value containing double quotes, like a JSON key file, substitutes as a string. A single quote in a value that fills such a reference is written as ''.What to do: In a spec imported by an earlier release, quote each reference to a JSON value by hand: '{{ .VAR }}'. |
| v0.29.0 | Changed: validate reports a value of the wrong type once per key, such as 'email' must be a string, instead of one raw decoding error. |
| v0.28.0 | Changed: api_key and site_id are required only where a connection needs them. With web as the only source type in device mode, api_key is optional, and so is site_id when sdk_version.web is v2. |
| v0.28.0 | Added: sdk_version, write_key, and anonymous_in_app, for the v2 web client in device mode. A spec without sdk_version runs the v1 client, so add these keys to a spec imported by an earlier release if the destination uses v2. |
| v0.28.0 | Added: warehouse source type, for destinations connected to a Reverse ETL source. Set connection_mode.warehouse: cloud for such a destination, or apply removes the entry. |
For changes across every destination type, see Destination Type Changes by Release.
See more
- Customer.io Destination for the API key and site ID, and the per-mode settings
- Destination Type Reference for Rudder CLI for the rules shared across destination types
- Destination YAML Reference for the spec envelope