Skip to content

Commit 4c29ddf

Browse files
Merge pull request #5520 from jkalamarz-survicate/survicate-dependency-plugin
Add Survicate Plugin
2 parents 8ecb1c5 + 22874b6 commit 4c29ddf

File tree

4 files changed

+170
-0
lines changed

4 files changed

+170
-0
lines changed

src/connections/sources/catalog/libraries/mobile/apple/destination-plugins/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ plugins:
5656
url: https://cdn.filepicker.io/api/file/fb5lNYEhQoWnABOjynZ6
5757
mark:
5858
url: https://cdn.filepicker.io/api/file/kWmScDJ3SvK1QBZTChGQ
59+
- name: Survicate
60+
url: connections/sources/catalog/libraries/mobile/apple/destination-plugins/survicate-swift/
61+
logo:
62+
url: https://cdn.filepicker.io/api/file/BUciQq3kSzqCn8EKMtBN
63+
mark:
64+
url: https://cdn.filepicker.io/api/file/0H2JyPoRT4K3CnBQcHPn
5965
- name: Quantcast
6066
url: connections/sources/catalog/libraries/mobile/apple/destination-plugins/quantcast-swift/
6167
logo:
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
title: Analytics Swift Survicate Plugin
3+
strat: swift
4+
---
5+
6+
[Survicate](https://survicate.com/){:target="_blank"} is an all-in-one customer feedback platform that helps you collect and act on feedback from your customers. It helps you understand your customers and improve their experience with your product or service.
7+
8+
Add Survicate device mode support to your applications using this plugin for [Analytics-Swift](https://github.com/segmentio/analytics-swift){:target="_blank"}.
9+
10+
## Adding the dependency
11+
12+
When you add the Analytics Swift Survicate Plugin, the Survicate library is installed as an additional dependency.
13+
14+
### Using Xcode
15+
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:
16+
17+
https://github.com/survicate/analytics-swift-survicate.git
18+
19+
You'll then have the option to pin to a version or specific branch, and select which project in your workspace to add it to. Once you've made your selections, click the `Add Package` button.
20+
21+
### Using Package.swift
22+
23+
Open your Package.swift file and add the following to your the `dependencies` section:
24+
25+
```swift
26+
.package(
27+
name: "SurvicateDestination",
28+
url: "https://github.com/survicate/analytics-swift-survicate.git",
29+
from: "3.0.2"
30+
),
31+
```
32+
33+
```swift
34+
import Segment
35+
import SurvicateDestination // <-- Add this line
36+
```
37+
38+
39+
> info " "
40+
> When you add the Analytics Swift Survicate Plugin, the Survicate library is installed as an additional dependency.
41+
42+
43+
## Using the Plugin in your App
44+
45+
Open the file where you setup and configure the Analytics-Swift library. Add this plugin to the list of imports.
46+
47+
Just under your Analytics-Swift library setup, call `analytics.add(plugin: ...)` to add an instance of the plugin to the Analytics timeline.
48+
49+
Your events will now begin to flow to Survicate in device mode.
50+
51+
### Using the SurvicateDestination plugin
52+
53+
#### Identify
54+
55+
In the SurvicateDestination plugin, the Identify event from Segment is transferred to the setUserTrait method of Survicate. This is achieved within the identify function of the SurvicateDestination class. The traits and userId from the Identify event are extracted and set as user traits in Survicate using the setUserTrait method. The traits are a dictionary where each key-value pair is set as a user trait. The userId is also set as a user trait with the key "userId".
56+
57+
#### Track
58+
59+
In the SurvicateDestination plugin, the Track method from Segment is used as the invokeEvent method in Survicate. This means that when you track an event in Segment, it will be invoked in Survicate.
60+
61+
#### Screen
62+
63+
Similarly, the Screen method from Segment is used as the enterScreen method in Survicate. This means that when you track a screen in Segment, it will be entered in Survicate.
64+
65+
#### Reset
66+
67+
The reset method from Segment is used as the reset method in Survicate. This means that when you reset the user in Segment, it will be reset in Survicate.

src/connections/sources/catalog/libraries/mobile/react-native/destination-plugins/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ plugins:
6868
url: https://cdn.filepicker.io/api/file/pUF0kwpTTu0Z5POuzZXV
6969
mark:
7070
url: https://cdn.filepicker.io/api/file/0mdiroESxtRQBoR8ieBg
71+
- name: Survicate
72+
url: connections/sources/catalog/libraries/mobile/apple/destination-plugins/survicate-react-native/
73+
logo:
74+
url: https://cdn.filepicker.io/api/file/BUciQq3kSzqCn8EKMtBN
75+
mark:
76+
url: https://cdn.filepicker.io/api/file/0H2JyPoRT4K3CnBQcHPn
7177
- name: Taplytics
7278
url: connections/sources/catalog/libraries/mobile/react-native/destination-plugins/taplytics-react-native/
7379
logo:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
title: React Native Survicate Plugin
3+
strat: react-native
4+
---
5+
6+
[Survicate](https://survicate.com/){:target="_blank"} is an all-in-one customer feedback platform that helps you collect and act on feedback from your customers. It helps you understand your customers and improve their experience with your product or service.
7+
8+
9+
## Installation
10+
11+
You need to install the `@survicate/analytics-react-native-survicate` and the `@survicate/react-native-survicate` dependencies.
12+
13+
Using NPM:
14+
```bash
15+
npm install --save @survicate/analytics-react-native-survicate @survicate/react-native-survicate
16+
```
17+
18+
Using Yarn:
19+
```bash
20+
yarn add @survicate/analytics-react-native-survicate @survicate/react-native-survicate
21+
```
22+
23+
### Configuring
24+
1. Add your Survicate workspace key to `Info.plist`
25+
```
26+
<key>Survicate</key>
27+
<dict>
28+
<key>WorkspaceKey</key>
29+
<string>YOUR_WORKSPACE_KEY</string>
30+
</dict>
31+
```
32+
2. run command `pod install` in your `ios` directory
33+
34+
### Configuring Survicate Bindings for Android
35+
36+
1. Add maven repository to your project `build.gradle` located under `android` directory
37+
```
38+
allprojects {
39+
repositories {
40+
// ...
41+
maven { url 'https://repo.survicate.com' }
42+
}
43+
}
44+
```
45+
46+
2. Add your Survicate workspace key to `AndroidManifest.xml`
47+
48+
```java
49+
<application
50+
android:name=".MyApp"
51+
>
52+
<!-- ... -->
53+
<meta-data android:name="com.survicate.surveys.workspaceKey" android:value="YOUR_WORKSPACE_KEY"/>
54+
</application>
55+
```
56+
57+
## Usage
58+
59+
Follow the [instructions for adding plugins](https://github.com/segmentio/analytics-react-native#adding-plugins){:target="_blank"} on the main Analytics client:
60+
61+
In your code where you initialize the analytics client call the `.add(plugin)` method with an `SurvicatePlugin` instance:
62+
63+
```ts
64+
import { createClient } from '@segment/analytics-react-native';
65+
66+
import { SurvicatePlugin } from '@segment/analytics-react-native-plugin-survicate';
67+
68+
const segmentClient = createClient({
69+
writeKey: 'SEGMENT_KEY'
70+
});
71+
72+
segmentClient.add({ plugin: new SurvicatePlugin() });
73+
```
74+
75+
### Using the Survicate plugin
76+
77+
#### Identify
78+
79+
In the SurvicateDestination plugin, the Identify event from Segment is transferred to the setUserTrait method of Survicate. This is achieved within the identify function of the SurvicateDestination class. The traits and userId from the Identify event are extracted and set as user traits in Survicate using the setUserTrait method. The traits are a dictionary where each key-value pair is set as a user trait. The userId is also set as a user trait with the key "userId".
80+
81+
#### Track
82+
83+
In the SurvicateDestination plugin, the Track method from Segment is used as the invokeEvent method in Survicate. This means that when you track an event in Segment, it will be invoked in Survicate.
84+
85+
#### Screen
86+
87+
Similarly, the Screen method from Segment is used as the enterScreen method in Survicate. This means that when you track a screen in Segment, it will be entered in Survicate.
88+
89+
#### Reset
90+
91+
The reset method from Segment is used as the reset method in Survicate. This means that when you reset the Segment client, the Survicate client will also be reset.

0 commit comments

Comments
 (0)