When you create a Customer.io account, you get a unique
You should include this snippet on every page in your app, immediately before the closing
Use the right snippet for your region
track-eu.js. If you use the US-based snippet for an EU-region account, we’ll redirect requests accordingly, but your data may be subject to logging in the US.
To segment users and send emails, you need to identify your users to us. To let us know exactly which users are sending data through your app, you’ll need to add this
**The first time you call ** `_cio.identify`, you _must_ send the following:
id: the person’s unique identifier. If your workspace uses email as a unique identifier, this value is an email address. Otherwise,
idshould be a value that maps a person to your backend systems.
…and we strongly recommend you send:
created_at(a timestamp which represents when they first signed up)
You can also send in additional user attributes that are of value to you. In the above example we send
plan_name attributes. You can use these attributes in the body of an email, or you can use them to segment your users.
- We only track activity for users registered in your app, after
_cio.identifyis called. We do not track anonymous or unregistered user activity.
- To update an existing user’s attributes, just send the
_cio.identifycall again. You must include their
idand any new attribute values. If the attributes already exist in their profile, we’ll overwrite them. If there are any new attributes included in the call, we’ll add them to the profile.
- In addition to attributes, you may want to track custom events like “watchedIntroVideo” or “purchased”. Note,
_cio.trackcalls should only be made after
_cio.identifyis called for the currently logged in user. Otherwise the events will not be associated with a known user in your account. Here are a few examples: