Skip to content

Batch documentation #7677

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 10 additions & 90 deletions src/connections/destinations/catalog/batch/index.md
Original file line number Diff line number Diff line change
@@ -1,101 +1,21 @@
---
title: Batch Destination
id: 596d11f870a3e552b957e6d9
---
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"}.

## Getting Started
{% include content/plan-grid.md name="actions" %}

* Batch.com supports the `screen`, `track`, `identify` and `group` methods.

* Make a Batch.com account.
* Turn on Batch.com using Segment dashboard.
* Enter your Batch LIVE API Key. You can find it in your dashboard, under 'settings'.
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.

Events tracked using Segment's `track`/`screen` will automatically be tracked. `Identify` and `group` calls will also be mapped to Batch user data.
This destination is maintained by Batch. For any issues with the destination, [contact their Support team](mailto:support@batch.com).

## Android
## Getting started

### Installation
1. From your workspace's [Destination catalog page](https://app.segment.com/goto-my-workspace/destinations/catalog){:target="_blank"} search for Batch.
2. Select **Batch** and click **Add Destination**.
3. Select an existing Source to connect to Batch (Actions).
4. Go to the [Batch dashboard](https://dashboard.batch.com/){:target="_blank"}, find and copy the **Project Key** / **REST API Key**
5. Enter the **Project Key** / **REST API Key** in the Batch destination settings in Segment.

Add the following dependency in your build.gradle:

```
compile "com.batch.android:sdk-segment-integration:+"
```

Import the integration:

```
import com.segment.analytics.android.integrations.batch.BatchIntegration;

```

Then, add the factory to your Analytics instance:

```java
Analytics analytics = new Analytics.Builder(this, "write_key")
.use(BatchIntegration.getFactory(this))
.build();
```


## iOS

### Installation

Add the following Cocoapods dependency:

```
pod 'Segment-Batch'
```

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:

```
pod 'Batch'
pod 'Segment-Batch/StaticLibWorkaround'
```

Then, add the integration factory in your Analytics instance:

```objc
#import <Segment-Batch/SEGBatchIntegrationFactory.h>

SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"MySegmentWriteKey"];
[config use:[SEGBatchIntegrationFactory instance]];
[SEGAnalytics setupWithConfiguration:config];
```

## Server Side

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.

## Screen

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.

## Identify

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`.

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.

## Track

When you `track` an event, we will send that event to Batch after converting the name to fit Batch's event naming rules.

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.
The events `title` property will become the event's label.

## Group

When you call `group`, we will set the group ID in a user attribute named `SEGMENT_GROUP`.

## Features

All of our supported Segment integration features will work automatically, with no action or specific properties required on your side.

Batch's other features are available directly by using the native SDK, which comes bundled with this integration.

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).
{% include components/actions-fields.html %}