Skip to main content

How to target Customer.io segments and attributes in Mida

Connect Customer.io once and show an A/B test or a personalization only to the people in the segments and with the attributes you choose.

Connect Customer.io once and Mida can show an A/B test or a personalization only to the people you choose in Customer.io, for example paying customers, trial users, or everyone in a segment. You paste one API key. There is no code to add to your site or your emails.

It also works the other way: Mida can save a survey answer, or any other attribute you choose, onto the person in Customer.io, so your campaigns can use it.

Plan: targeting by Customer.io audience needs a paid Mida plan. Sending experiment data to Customer.io is included on every plan.

How it works

The short version: a person clicks a link in one of your Customer.io emails. Customer.io adds an ID to that link. Mida reads the ID, looks the person up in your Customer.io workspace, and saves their segments and the attributes you picked on their Mida visitor. Your targeting rules then read those values.

1. The connection

You connect with a Customer.io App API key. Mida uses it for three things only:

  • To check the key works when you connect.

  • To list your segments and attributes so you can pick them in Mida.

  • To look up one person at a time when they arrive from an email.

The key is encrypted at rest and is never shown again after you paste it. An App API key can only read, so Mida cannot send emails, edit people, or change segments with it. Mida finds your data region (US or EU) by itself.

Saving attributes onto people uses a second pair of credentials, your Tracking API Site ID and key. They are optional. See "Send Mida attributes to Customer.io" below.

2. How Mida knows who the visitor is

Customer.io adds a parameter called _cio_id to the tracked links in your messages. It looks like this:

https://yoursite.com/pricing?_cio_id=0a1b2c3d4e5f6a7b

When the visitor lands, the Mida tag reads that ID and asks Mida to look the person up. From then on Mida remembers them in that browser, so they stay recognized on later visits even when the link has no ID.

Situation

Is the visitor recognized?

Clicked a link in a Customer.io email, SMS or WhatsApp message

Yes, from their next page view.

Was identified on your site by Customer.io's own script, for example a signup form that calls identify

Yes, from their next page view. See below.

Comes back later in the same browser

Yes. Mida refreshes their data once per browser session.

Opens your site on another device or browser

Not until they click a Customer.io link there too.

Never clicked one of your messages and was never identified on your site

No. They stay anonymous and do not match Customer.io rules.

Cleared their cookies and site data, or uses a private window

Not until they click a Customer.io link again.

Mida leaves _cio_id in the address bar. Customer.io's own script reads it too, and removing it would break that.

Without an email click. When Customer.io's JavaScript snippet identifies someone on your site, it saves their ID in a cookie named _cioid. That ID is the one you passed to identify, often their email address. Mida reads it too, finds the person in Customer.io, and from then on keeps only their cio_id in the browser, never the email.

  • This needs Customer.io's classic JavaScript snippet on your site, and the Customer.io integration turned on in Mida. The newer Data Pipelines script does not set this cookie.

  • Mida checks once per browser session. An ID Customer.io does not know is not asked about again for a day.

  • An ID from a link always comes first. With Strict Consent Mode, Mida waits for consent before reading anything.

3. What Mida copies

Data

What is copied

Name in Mida

Segments

Every segment in your workspace, saved as true when the person is in it and false when they are not. Always on.

cio_segment_ plus the segment name, for example cio_segment_paid_users

Attributes

Only the attributes you tick. Nothing else.

cio_ plus the attribute name, for example cio_plan_name

Segment names are turned into lower case with underscores, so "Paid Users" becomes cio_segment_paid_users. You do not have to work these out. Mida lists the exact name next to each segment, and you can click it to copy.

The values are saved on the visitor in Mida. They are not sent back to the visitor's browser, so nobody can read a person's attributes by looking at your page or by reusing a link.

4. When targeting applies

  • Targeting applies from the visitor's next page view, not the page they land on from the email. The lookup runs in the background so it never slows your page or delays a test.

  • Mida keeps a person's data for up to 6 hours before asking Customer.io again. A change you make in Customer.io can take that long to show up in Mida.

  • When a person joins or leaves a segment, Mida updates the visitor the next time their data refreshes.

Before you start

  1. In Customer.io, open Workspace Settings, then URL Parameters, and check that Add _cio_id URL parameter is on. It is on by default for workspaces created after 12 July 2021. Turning it on only affects messages you send afterwards.

  2. Make sure link tracking is on for your messages. It is on by default. Links that are not tracked do not get the ID.

  3. Create an App API key. In Customer.io, go to Account Settings, then API Credentials, then App API Keys, and create a key for the workspace you send from. Copy it.

  4. Make sure the Mida tag is installed on the pages your emails link to.

Connect Customer.io

  1. In Mida, open Integrations and choose Customer.io.

  2. Turn the integration on.

  3. Open the Config tab.

  4. Paste your key into App API key and click Connect. Leave Site ID and Tracking API key empty unless you also want to send attributes to Customer.io.

  5. When it says Connected, tick the attributes you want to use under Attributes to bring in, then click Save attributes. You can pick up to 40.

Only an Owner or Admin can connect, replace the key, or disconnect. Everyone else sees the connection as read-only.

Segments need no setup. Every segment the person belongs to is brought in.

Target a test or a personalization

  1. Open your test and go to Targeting.

  2. Add a Segment rule.

  3. In the attribute field, type the name from the Customer.io Config tab.

  4. Choose a condition and a value, then save.

Some examples:

You want to reach

Attribute

Condition

Value

People in your "Paid Users" segment

cio_segment_paid_users

Is true

People on the Growth plan

cio_plan_name

Is equal to

Growth

People with more than 5 seats

cio_seats

Greater than

5

Known contacts who are not in "Paid Users"

cio_segment_paid_users

Is false

Everyone Mida has recognized from Customer.io

cio_segment_paid_users (any segment)

Exists

A few things to know about conditions:

  • To target people in a segment use Is true. To target known contacts who are not in it use Is false.

  • Anonymous visitors never match a Customer.io rule, including "Is false" and "Does not exist". Mida knows nothing about them, so it leaves them out. That means you cannot use a Customer.io rule to say "everyone except my customers" when "everyone" includes people who never clicked an email.

  • Text conditions are case sensitive. "Growth" and "growth" are different values.

  • All Customer.io values arrive as text. Number and date conditions still work as long as the value looks like a number or a date.

For the full list of conditions, see How to use Segment & Event Filtering.

Send Mida attributes to Customer.io

Mida can save attributes onto the matching person in Customer.io. The usual case is a survey: a visitor answers "What is your team size?" on your site, and the answer becomes an attribute on their Customer.io profile that your campaigns and segments can use.

Set it up

  1. In Customer.io, open Account Settings, then API Credentials, then Tracking API Keys. Copy the Site ID and API Key for your workspace.

  2. In Mida, open the Customer.io Config tab. Under Send Mida attributes to Customer.io, paste the Site ID and the Tracking API key, then click Connect.

  3. Tick the attributes you want to send, then click Save. You can pick up to 20.

What you can pick from

  • Survey answers: every question with Save the answer to the visitor turned on, shown with the question and its survey.

  • Attributes on your visitors: names Mida has seen on your recent visitors, for example ones you set with mida.identify(), with how many visitors carry each.

  • If an attribute has not reached a visitor yet, type its name in Not listed? and click Add.

How it behaves

  • The attribute is saved in Customer.io under the same name, for example team_size.

  • It is only sent for visitors Mida has recognized from one of your Customer.io messages. Anonymous visitors are never sent.

  • If a visitor answers first and is recognized later, the answer is sent as soon as they are recognized.

  • Nothing is sent until a name is on the list. Mida never sends an attribute you did not list.

  • Mida never creates a new person in Customer.io. It only updates people who already exist.

  • The same value for the same person is sent once an hour at most.

  • A value overwrites whatever that attribute held before. Pick names that do not clash with attributes you already keep in Customer.io, unless you mean to update them.

To stop sending one attribute, untick it and click Save. To stop altogether, click Stop sending. Mida deletes the stored Tracking key. Targeting keeps working.

Test that it works

  1. Pick an attribute or segment that you are in yourself, and create a test that targets it.

  2. Send yourself a Customer.io message with a link to your site.

  3. Click the link in a normal browser window. Check that the address contains _cio_id.

  4. Go to another page on your site, or reload. You should now be in the test.

If you are not, see the troubleshooting table below.

Privacy and consent

  • Mida copies only segment membership and the attributes you tick. It does not copy email addresses, names or anything else unless you select it.

  • In the other direction, Mida sends Customer.io only the attributes you list under Send Mida attributes, and only for recognized visitors.

  • If you use Strict Consent Mode, Mida does not read or store the Customer.io ID until the visitor gives consent. If consent is withdrawn, the stored ID is removed from the browser.

  • Mida never creates a visitor from a Customer.io lookup, so this does not add to your monthly tracked users.

  • When you disconnect, Mida deletes the stored key and stops looking people up. Values already saved on visitors stay there, but they are no longer refreshed.

Limits

Limit

Value

Attributes you can bring in

40 per project

Length of an attribute value

200 characters. Longer values are cut.

Segments in your workspace that Mida tracks

200

How long a person's data is reused before Mida asks Customer.io again

Up to 6 hours

Email platforms per project

One

Customer.io limits how many requests an API key can make each second. Mida stays well under that limit. Right after a large send, a few visitors may be recognized one page view later than usual.

Troubleshooting

What you see

What to check

"Customer.io rejected this key"

You need an App API key. A Tracking API key or Site ID will not work. Check the key belongs to the workspace you send from.

My links have no _cio_id

Turn on Add _cio_id URL parameter in Customer.io under Workspace Settings, URL Parameters, and make sure link tracking is on. Messages sent before you turned it on do not have the ID.

I clicked the email but I am not in the test

Targeting starts on the next page view. Load a second page. Also check the test's other targeting rules.

An attribute is missing from the list

Mida builds the list from one of your contacts. If that contact does not have the attribute, it is not shown. Contact us in the chat and we will help.

I changed someone in Customer.io and Mida has not noticed

Mida reuses a person's data for up to 6 hours.

The card says "Needs attention"

Customer.io stopped accepting one of the keys, usually because it was deleted or rotated. The message says which. Click Replace key for the App API key, or Stop sending and connect again for the Tracking API key.

A survey answer is not showing up in Customer.io

Check the answer is ticked under Send Mida attributes to Customer.io and saved. The visitor must also have clicked one of your Customer.io messages in that browser. Give it a minute, then reload the person in Customer.io.

"Customer.io rejected this Site ID and Tracking API key"

These come from Tracking API Keys, not App API Keys. Copy both values from the same row.

It works for me but not on my phone

Each browser has to click a Customer.io link once before Mida can recognize it.

Sending experiment data to Customer.io

Separately from all of the above, when the integration is turned on Mida sends each visitor's experiment and variant to Customer.io as an event, so you can build segments and campaigns from what people saw. That part works through the Customer.io script on your site and does not need any API key.

FAQ

Does this work for visitors who never opened my emails?

Only if Customer.io's own script identified them on your site, as described in "How Mida knows who the visitor is". Everyone else is anonymous until they click a link from Customer.io.

Do I need to change my emails?

No. Customer.io adds the ID to tracked links by itself.

Will it slow down my site?

No. The lookup happens in the background after your page and your tests have loaded.

Can I send survey answers to Customer.io?

Yes. Add your Tracking API Site ID and key, then list the attribute names to send. See "Send Mida attributes to Customer.io" above.

Can visitors see their Customer.io data?

No. It is stored in Mida and used for targeting only. It is not sent to the browser.

Can I use this with other email platforms?

Yes. Mida also connects HubSpot, Mailchimp, Klaviyo, Kit, ActiveCampaign, MailerLite, Bento and Ontraport, and a project can connect several at once, for example HubSpot as your CRM next to Customer.io. Each is set up on its own card. A visitor recognized by more than one gets each platform's data side by side.

Did this answer your question?