|
1 | 1 | --- |
2 | 2 | title: Batch Destination |
3 | | -id: 596d11f870a3e552b957e6d9 |
4 | 3 | --- |
5 | | -The Batch.com integration code is open sourced on GitHub. Feel free to check it out: [iOS](https://github.com/BatchLabs/ios-segment-integration){:target="_blank"}, [Android](https://github.com/BatchLabs/android-segment-integration){:target="_blank"}. |
6 | 4 |
|
7 | | -## Getting Started |
| 5 | +{% include content/plan-grid.md name="actions" %} |
8 | 6 |
|
9 | | -* Batch.com supports the `screen`, `track`, `identify` and `group` methods. |
10 | 7 |
|
11 | | -* Make a Batch.com account. |
12 | | -* Turn on Batch.com using Segment dashboard. |
13 | | -* Enter your Batch LIVE API Key. You can find it in your dashboard, under 'settings'. |
| 8 | +Batch is a powerful customer engagement platform that helps businesses deliver personalized, timely notifications and messages to boost user retention and drive growth. Discover how Batch can transform your communication strategy at Batch. |
14 | 9 |
|
15 | | -Events tracked using Segment's `track`/`screen` will automatically be tracked. `Identify` and `group` calls will also be mapped to Batch user data. |
| 10 | +This destination is maintained by Batch. For any issues with the destination, [contact their Support team](mailto:support@batch.com). |
16 | 11 |
|
17 | | -## Android |
| 12 | +## Getting started |
18 | 13 |
|
19 | | -### Installation |
| 14 | +1. From your workspace's [Destination catalog page](https://app.segment.com/goto-my-workspace/destinations/catalog){:target="_blank"} search for Batch. |
| 15 | +2. Select **Batch** and click **Add Destination**. |
| 16 | +3. Select an existing Source to connect to Batch (Actions). |
| 17 | +4. Go to the [Batch dashboard](https://dashboard.batch.com/){:target="_blank"}, find and copy the **Project Key** / **REST API Key** |
| 18 | +5. Enter the **Project Key** / **REST API Key** in the Batch destination settings in Segment. |
20 | 19 |
|
21 | | -Add the following dependency in your build.gradle: |
22 | 20 |
|
23 | | -``` |
24 | | -compile "com.batch.android:sdk-segment-integration:+" |
25 | | -``` |
26 | | - |
27 | | -Import the integration: |
28 | | - |
29 | | -``` |
30 | | -import com.segment.analytics.android.integrations.batch.BatchIntegration; |
31 | | -
|
32 | | -``` |
33 | | - |
34 | | -Then, add the factory to your Analytics instance: |
35 | | - |
36 | | -```java |
37 | | -Analytics analytics = new Analytics.Builder(this, "write_key") |
38 | | - .use(BatchIntegration.getFactory(this)) |
39 | | - .build(); |
40 | | -``` |
41 | | - |
42 | | - |
43 | | -## iOS |
44 | | - |
45 | | -### Installation |
46 | | - |
47 | | -Add the following Cocoapods dependency: |
48 | | - |
49 | | -``` |
50 | | -pod 'Segment-Batch' |
51 | | -``` |
52 | | - |
53 | | -If you integrate in a Swift project or have `use_frameworks!` in your Podfile, you need to use the following to work around due to a limitation with Cocoapods: |
54 | | - |
55 | | -``` |
56 | | -pod 'Batch' |
57 | | -pod 'Segment-Batch/StaticLibWorkaround' |
58 | | -``` |
59 | | - |
60 | | -Then, add the integration factory in your Analytics instance: |
61 | | - |
62 | | -```objc |
63 | | -#import <Segment-Batch/SEGBatchIntegrationFactory.h> |
64 | | - |
65 | | -SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"MySegmentWriteKey"]; |
66 | | -[config use:[SEGBatchIntegrationFactory instance]]; |
67 | | -[SEGAnalytics setupWithConfiguration:config]; |
68 | | -``` |
69 | | -
|
70 | | -## Server Side |
71 | | -
|
72 | | -You can transmit server-side data from Segment to Batch with a [destination function](/docs/connections/functions/destination-functions/). Follow the steps outlined [in Batch's documentation](https://help.batch.com/en/articles/2208243-how-to-connect-batch-to-segment){:target="_blank"} for a smooth integration. |
73 | | -
|
74 | | -## Screen |
75 | | -
|
76 | | -When you call `screen` in your mobile app, we send a screen view to an event named `SEGMENT_SCREEN`. The screen name will be tracked as the event's label. |
77 | | -
|
78 | | -## Identify |
79 | | -
|
80 | | -When you `identify` a user, we'll pass that user's information to Batch as the custom user identifier. Batch supports tracking anonymous users, but not through Segment's `anonymousId`. |
81 | | -
|
82 | | -Tracked events are attached to the installation ID, and the installation ID itself can be attached/detached to a user at a later date, with no data loss. |
83 | | -
|
84 | | -## Track |
85 | | -
|
86 | | -When you `track` an event, we will send that event to Batch after converting the name to fit Batch's event naming rules. |
87 | | -
|
88 | | -For example, an event named `Ad Shown` will become `AD_SHOWN`. Note that this means that event names longer than 30 characters will be truncated. |
89 | | -The events `title` property will become the event's label. |
90 | | -
|
91 | | -## Group |
92 | | -
|
93 | | -When you call `group`, we will set the group ID in a user attribute named `SEGMENT_GROUP`. |
94 | | -
|
95 | | -## Features |
96 | | -
|
97 | | -All of our supported Segment integration features will work automatically, with no action or specific properties required on your side. |
98 | | -
|
99 | | -Batch's other features are available directly by using the native SDK, which comes bundled with this integration. |
100 | | -
|
101 | | -To use the Batch native SDK through Segment, follow the [instructions for Android](/docs/connections/sources/catalog/libraries/mobile/android/#how-can-i-use-a-destination-specific-feature) and [instructions for iOS](/docs/connections/sources/catalog/libraries/mobile/ios/#what-if-your-sdk-doesnt-support-feature-x). |
| 21 | +{% include components/actions-fields.html %} |
0 commit comments