Select spec version:

Customer.io Destination Config Reference

Complete Rudder CLI reference for the Customer.io destination config keys, API versions, web and mobile device mode settings, and secrets.
Available Plans
  • free
  • growth
  • enterprise

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: customerio
  • definition_version: 1

Sample configuration

yaml
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:
            - marketing

The 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.

KeyRequired when
api_keyAlways, unless web is the only source type and connects in device mode. Also checked per connection — see Connect a source.
site_idAlways, unless web is the only source type and connects in device mode with sdk_version.web set to v2. Also checked per connection.
write_keyconnection_mode.web is device and sdk_version.web is v2
user_id_identifier_typeapi_version is v2, including when it’s omitted
Write sdk_version out 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 as v1. The v2 default applies only inside an sdk_version block you write.

Connection

site_id

RequiredSecret

Type: string

Description: Your Customer.io site ID.

Notes:

  • Required unless web is the only source type and connects in device mode with sdk_version.web set to v2. 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

RequiredSecret

Type: string

Description: Your Customer.io Tracking API key, paired with site_id.

Notes:

  • Required unless web is the only source type and connects in device mode.
  • At most 100 characters, and must not contain line breaks.
  • A {{ path || fallback }} template is accepted in place of a literal.
Supply it as a {{ .VAR }} reference rather than a literal — see Secrets.

datacenter

Required

Type: string

Description: Region of your Customer.io account.

Notes:

  • US or EU.
  • 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. Needs user_id_identifier_type.
  • v1 — Customer.io’s per-endpoint APIs.
  • Omitting this key is the same as setting v2.

user_id_identifier_type

Required

Type: string

Description: Customer.io identifier that receives the RudderStack userId.

Notes:

  • Required when api_version is v2 — including when you omit api_version, since v2 is the default. Leave it unset only with v1.
  • One of id, email, phone, or cio_id. With phone, the value must read as E.164 — for example +15551234567.
userId is sent as this identifier for every event, with no fallback — choose id and 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. With v2, events without a userId fail.

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 — v1 or v2. Defaults to v2, but only inside an sdk_version block you write — an omitted block is read as v1.
  • Applies when connection_mode.web is device.
yaml
sdk_version:
  web: v2

write_key

Required

Type: 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 when connection_mode.web is device and sdk_version.web is v2.
  • 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 to false.
  • Applies when sdk_version.web is v2. Rudder CLI also accepts it with v1, 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 to true; 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 to false.
  • Applies to the v1 web client. Rudder CLI also accepts it with v2, 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 to true; Rudder CLI doesn’t fill them in.
yaml
auto_track_device_attributes:
  android: true
  ios: false

background_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 than 10. 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 than 30. 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 when connection_mode.web is device — 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.web is device. Leave it unset otherwise.
  • whitelist — array of event names to allow; every other track event is dropped.
  • blacklist — array of event names to drop; every other track event 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 device for android_kotlin.
yaml
connection_mode:
  web: device
  android: device
  ios: cloud

Source types

Customer.io accepts events from these source types in the mentioned connection modes:

Source typeConnection mode
androidcloud, device
android_kotlincloud
ioscloud, device
ios_swiftcloud
webcloud, device
unitycloud
cloudcloud
react_nativecloud
fluttercloud
cordovacloud
warehousecloud

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 warehouse entry still belongs in the spec so that apply keeps 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 amp and shopify are 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_id

What 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:

yaml
config:
  site_id: "{{ .CUSTOMERIO_SITE_ID }}"
  api_key: "{{ .CUSTOMERIO_API_KEY }}"
bash
export RUDDER_CUSTOMERIO_SITE_ID="..."
export RUDDER_CUSTOMERIO_API_KEY="..."
rudder-cli apply

# or
rudder-cli apply --var-file secrets.vars.yaml

Note that:

  • rudder-cli import writes 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) or write_key (v2) is embedded in the page’s JavaScript, so neither value is hidden from a visitor. Masking site_id protects your YAML, not the value itself. write_key isn’t a secret key, so import writes it as a literal.

See How to Use Variable Substitution in Rudder CLI.

Changes by release

VersionChange
v0.29.0Breaking: 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.0Breaking: 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.0Changed: 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.0Changed: 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.0Changed: 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.0Changed: 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.0Added: 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.0Added: 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

Questions? Let's figure it out together.

Join the RudderStack Slack community to connect with other users, customers, and the RudderStack team — or reach out for direct support.