Select spec version:

Customer.io Destination Config Reference Beta

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

    send_page_name_in_sdk:
      web: true
    data_use_in_app:
      web: false
    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 — see Device mode.

Config keys

config accepts only the keys listed below. The shared config key rules cover unknown keys, defaults, and immutability.

Connection

site_id

RequiredSecret

Type: string

Description: Your Customer.io site ID.

Notes:

  • 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 API key, paired with site_id.

Notes:

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

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.

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

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.

The dashboard additionally offers Customer.io to AMP, Shopify, and Reverse ETL sources. Rudder CLI doesn’t manage those connections, so amp, shopify, and warehouse are invalid here.

Connect a source

An event stream connection to this destination is checked against two 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. An unsupported type reports:

destination 'customerio-prod' (type 'customerio') does not support source 'my-source':
source type 'amp' is not among supported source types: android, android_kotlin, ...

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'

Customer.io needs no additional config keys to connect a source of any type, in any mode.

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:

  • The YAML that rudder-cli import writes may or may not include secret keys. Before you apply, make sure every secret key your configuration needs is present and populated through variable substitution.
  • In web device mode the site ID is embedded in the page’s JavaScript, so masking it protects your YAML, not the value itself.

See How to Use Variable Substitution in Rudder CLI.

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.