Segment is a Customer Data Platform (CDP) that collects and processes data from your users. With Segment, you can direct this data to other tools, including 1Flow, to gain insights into your product experience.
If your team already uses Segment, you can easily install the 1Flow SDK and send the necessary data for triggering surveys and targeting users.
This means any events and user identity data you’re tracking in Segment can be utilized by 1Flow – without extra development effort.
First, go to your Segment account.
- From the Segment web app, click Catalog, then search for 1Flow Mobile Plugin.
- Click Add Destination.
- Select an existing Source to connect to 1Flow Mobile Plugin.
- Go to 1flow.ai -> Settings -> Project Settings, copy the 1Flow project API key, and paste it into the Destination Settings in Segment.
- Depending on the mobile source you’ve selected, include 1Flow’s library by adding the following lines to your dependency configuration.
Step 1: Add Segment1Flow Package using Swift Package Manager
In the Xcode File menu, click Add Packages. You’ll see a dialog where you can search for Swift packages. In the search field, enter the URL to this repo.
You’ll then have the option to pin to a version, or specific branch, as well as which project in your workspace to add it to. Once you’ve made your selections, click the Add Package button.
Step 2: Initialize Segment and add 1Fow Destination
import Segment1Flow ... let config = Configuration(writeKey: "YOUR_WRITE_KEY_HERE") let analytics = Analytics(configuration: config) analytics.add(plugin: OneFlowDestination())
If you’re not familiar with the Segment Specs, take a look to understand what the Identify method does. An example call would look like:
analytics.identify(userId: "firstname.lastname@example.org", traits: [ "name": "Peter Gibbons", "email": "email@example.com", "mobile": 1234567890 ])
When you call identify method of segment, it will be equivalent to
If you’re not familiar with the Segment Specs, take a look to understand what the Track method does. An example call would look like:
Any value passed in
name, will be eventName and if you have passed any event property, then it will be event
Send Screen calls to record which mobile app screens users have viewed. For example:
Segment sends Screen calls to 1Flow as a
screen_viewif a screen name isn’t provided).
Segment lets you change these destination settings from the Segment app without having to touch any code.