Skip to content

Commit 813396c

Browse files
Add Survicate Plugin
1 parent 8bd7588 commit 813396c

File tree

4 files changed

+166
-0
lines changed

4 files changed

+166
-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: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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 via this plugin for [Analytics-Swift](https://github.com/segmentio/analytics-swift)
9+
10+
## Adding the dependency
11+
12+
***Note:** the Survicate library itself will be installed as an additional dependency.*
13+
14+
### via 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, as well as which project in your workspace to add it to. Once you've made your selections, click the `Add Package` button.
20+
21+
### via Package.swift
22+
23+
Open your Package.swift file and add the following do 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+
*Note the Survicate library itself will be installed as an additional dependency.*
39+
40+
## Using the Plugin in your App
41+
42+
Open the file where you setup and configure the Analytics-Swift library. Add this plugin to the list of imports.
43+
44+
Just under your Analytics-Swift library setup, call `analytics.add(plugin: ...)` to add an instance of the plugin to the Analytics timeline.
45+
46+
Your events will now begin to flow to Survicate in device mode.
47+
48+
### using the SurvicateDestination plugin
49+
50+
***identify***
51+
52+
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 IdentifyEvent 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".
53+
54+
***track***
55+
56+
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.
57+
58+
***screen***
59+
60+
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.
61+
62+
***reset***
63+
64+
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:
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
title: Analytics Swift 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+
`SurvicatePlugin` for [Survicate](https://survicate.com/). Wraps [`react-native-survicate`](https://github.com/survicate/react-native-survicate).
9+
10+
## Installation
11+
12+
You need to install the `@survicate/analytics-react-native-survicate` and the `@survicate/react-native-survicate` dependency.
13+
14+
Using NPM:
15+
```bash
16+
npm install --save @survicate/analytics-react-native-survicate @survicate/react-native-survicate
17+
```
18+
19+
Using Yarn:
20+
```bash
21+
yarn add @survicate/analytics-react-native-survicate @survicate/react-native-survicate
22+
```
23+
24+
### Configuring
25+
- Add your Survicate workspace key to `Info.plist`
26+
```
27+
<key>Survicate</key>
28+
<dict>
29+
<key>WorkspaceKey</key>
30+
<string>YOUR_WORKSPACE_KEY</string>
31+
</dict>
32+
```
33+
- run command `pod install` in your `ios` directory
34+
35+
### Configuring Survicate Bindings for Android
36+
37+
- Add maven repository to your project `build.gradle` located under `android` directory
38+
```
39+
allprojects {
40+
repositories {
41+
// ...
42+
maven { url 'https://repo.survicate.com' }
43+
}
44+
}
45+
```
46+
- Add your Survicate workspace key to `AndroidManifest.xml`
47+
```java
48+
<application
49+
android:name=".MyApp"
50+
>
51+
<!-- ... -->
52+
<meta-data android:name="com.survicate.surveys.workspaceKey" android:value="YOUR_WORKSPACE_KEY"/>
53+
</application>
54+
```
55+
56+
## Usage
57+
58+
Follow the [instructions for adding plugins](https://github.com/segmentio/analytics-react-native#adding-plugins) on the main Analytics client:
59+
60+
In your code where you initialize the analytics client call the `.add(plugin)` method with an `SurvicatePlugin` instance:
61+
62+
```ts
63+
import { createClient } from '@segment/analytics-react-native';
64+
65+
import { SurvicatePlugin } from '@segment/analytics-react-native-plugin-survicate';
66+
67+
const segmentClient = createClient({
68+
writeKey: 'SEGMENT_KEY'
69+
});
70+
71+
segmentClient.add({ plugin: new SurvicatePlugin() });
72+
```
73+
74+
### using the Survicate plugin
75+
76+
***identify***
77+
78+
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 IdentifyEvent 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".
79+
80+
***track***
81+
82+
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.
83+
84+
***screen***
85+
86+
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.
87+
88+
***reset***
89+
90+
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)