Send events to Customer.io in RudderStack device mode.
5 minute read
After you have successfully instrumented Customer.io as a destination in RudderStack, follow this guide to correctly send your events to Customer.io in device mode.
Add Customer.io integration
Make sure to add the Customer.io integration to your project before sending events to Customer.io in device mode.
Depending on your integration platform, follow these steps :
Open the Podfile of your project and add the following:
pod'Rudder-CustomerIO','~> 1.1.0'
Run the pod install command.
Change the SDK initialization to the following snippet:
The identify event lets you identify a visiting user and associate them to their actions. It also lets you record the traits about them like their name, email address, etc.
userId is a mandatory field for Customer.io. RudderStack drops the event if it is absent.
RudderStack sends the createdAt field (mapped to Customer.io’s created_at property) to register the user signup time. If it is absent in the event, RudderStack automatically assigns the event’s timestamp to created_at before sending it to Customer.io.
Make sure the user ID and the email values match the Customer.io attributes. You can verify this by selecting that user in the People page in your Customer.io dashboard and clicking Attributes.
Track
The track event lets you record the user actions along with their associated properties and send them to Customer.io.
For anonymous users, Customer.io does not permit an event name of size more than 100 Bytes. RudderStack automatically trims the event name in such a scenario.
If you are using a native web SDK, RudderStack loads the Customer.io JavaScript snippet and captures the page views automatically.
You can also use the page event to record the page views along with the other page-related information.
A sample page call is as shown below:
// "Home" is the page name.
rudderanalytics.page("Home",{path:"path",url:"url",title:"title",search:"search",referrer:"referrer",});
Screen
The screen event is the mobile equivalent of the page event and lets you record the screen views on your mobile app along with other relevant information about the viewed screen.
If you have enabled screen views in your app implementation in the iOS or Android SDK, RudderStack registers the screen views as Viewed <screen_name> Screen in the user’s Activities tab.
RudderStack also forwards the event properties to Customer.io as received.
A sample screen call using RudderStack’s iOS SDK is shown below:
RudderStack transforms the above event as Viewed Main Screen before sending it to Customer.io.
Group
The group event lets you link an identified user with a group like a company, organization, or an account. It also lets you record any custom traits or properties associated with that group and send this information to Customer.io.
Enable the trackApplicationLifecycleEvents feature in your mobile SDK implementation code to use this feature.
Also, you need to register your device token after initializing the SDK. The following snippets demonstrate registering the device token for iOS and Android:
Make sure to fire the event just after setting the device token in your app, so RudderStack can immediately register the device token to Customer.io and not delay until the next lifecycle event.
The following snippets highlight how to send a device_token_registered event after setting the device token in your app:
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.