Adjust Destination

Segment makes it easy to send your data to Adjust (and lots of other destinations). Once you've tracked your data through our open source libraries we'll translate and route your data to Adjust in the format they understand. Learn more about how to use Adjust with Segment.

Getting Started

After enabling on Adjust through the Segment Destinations catalog, you will need to include Adjust’s library by adding the following lines to your dependency config:

For iOS:

To install the Segment-Adjust destination, simply add this line to your CocoaPods Podfile:

pod "Segment-Adjust"

After adding the dependency, you must register the destination with our SDK. To do this, import the Adjust destination in your AppDelegate:

#import <Segment-Adjust/SEGAdjustIntegrationFactory.h>

And add the following lines:

NSString *const SEGMENT_WRITE_KEY = @" ... ";
SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:SEGMENT_WRITE_KEY];

[config use:[SEGAdjustIntegrationFactory instance]];

[SEGAnalytics setupWithConfiguration:config];

For Android:

To install the Segment-Adjust destination, simply add this line to your gradle file:

compile 'com.segment.analytics.android.integrations:adjust:+'

After adding the dependency, you must register the destination with our SDK. To do this, import the Adjust destination:

import com.segment.analytics.android.integrations.adjust.AdjustIntegration;

And add the following line:

analytics = new Analytics.Builder(this, "write_key")
                .use(AdjustIntegration.FACTORY)
                .build();

After you build and release to the app store, we’ll automatically start translating and sending your data to Adjust.

Track

When you call track Segment maps the event to your pre-defined Adjust custom event. You must map your track events to your custom Adjust Event Token in your Adjust destination settings.

If you don’t provide a mapping, Adjust cannot accept the event. We include all the event properties as callback parameters on the Adjust event, and automatically translate revenue and currency to the appropriate Adjust event properties based on our spec’d properties.

Identify

When you call identify, Segment will call Adjust’s addSessionPartnerParameter method and set the userId and/or anonymousId. This will set these values within Adjust, and allow Adjust to send back attribution data from their servers.

Reset

When you call reset, Segment will reset these partner parameters via Adjust’s resetSessionPartnerParameters method.

iOS

Adjust’s iOS SDK automatically takes care of duplicate purchase events. We will automatically use Adjust’s transactionId-based deduplication when you send an orderId (see the ecommerce spec).

Server

If you are using a server only implementation of Adjust, please note that there are extra steps to get attribution data working. A server only implementation means that you are not bundling the Segment-Adjust SDK. For further information on how to get attribution data to Segment from Adjust’s servers, please reach out to the Adjust team at support@adjust.com.

We do however support tracking ecommerce events, and other general track events out of the box via our Adjust server-side component.

To send events to Adjust from the server, you must include the device ID as well as the device type in the context object of your event. For example:

analytics.track({
  userId: '019mr8mf4r',
  event: 'Item Purchased',
  properties: {
    revenue: 39.95,
    shippingMethod: '2-day'
  },
  context: {
    device: {
      id: '3e9ffbefafe0d903',
      type: 'Android'
    }
  }
});

Install Attributed

Segment will trigger an Install Attributed event if you have trackAttributionData enabled in your settings, and the Segment-Adjust SDK installed in your app.

Using Adjust’s Attribution callback, Segment listens for an attribution change from Adjust’s SDK and triggers the call with the following Adjust attribution parameters:

KeyValueDescription
providerAdjusthardcoded by Segment
trackerTokenattribution.trackerTokenthe tracker token of the current install
trackerNameattribution.trackerNamethe tracker name of the current install
campaign.sourceattribution.networkthe network grouping level of the current install
campaign.nameattribution.campaignthe campaign grouping level of the current install
campaign.contentattribution.clickLabelthe ad group grouping level of the current install
campaign.adCreativeattribution.creativethe creative grouping level of the current install
campaign.adGroupattribution.adgroupthe click label of the current install

If any value is unavailable, it will default to nil. This call will be sent to all enabled device and cloud mode destinations.

If you bundling the Segment-Adjust SDK and would like attribution data sent from Adjust’s servers, you can enable Segment as a Special Partner in Adjust. Once set up, Install Attributed will be sent server-side to Segment and on to enabled server-side destinations. Note: this server-side option will not include device context information. Please reach out to the Adjust team at support@adjust.com for questions related to enabling Segment as a Adjust Special Partner.

If you are relying on the Adjust server-side component, and you are not bundling the Segment-Adjust SDK, your installs will not be attributed.

Other Features

Environments

By default, our destination sends data to the Adjust Sandbox Environment. When you release your app to the app store, enable the Production option in the Adjust destination settings on Segment (or use two separate sources, one for dev & one for prod, with different environment settings for Adjust).

Callback Parameters

The destination sends all event properties as callback parameters to Adjust. To set Partner Parameters, you can access the Adjust SDK directly.

Note that we now support setting these Partner Parameters. Be sure you are pulling in the minimum versions for iOS 1.1.0 and Android 0.3.0.

Revenue Tracking

The destination will automatically recognize spec’d revenue and currency properties, and translate them to Adjust’s revenue tracking method.

Transaction Deduplication

The destination will automatically recognize the spec’d orderId property, and send it as the transaction id to Adjust for revenue de-duplication.

In-App Purchase Receipts

The destination does not currently support in-app purchase receipts. If this is important to you, please let us know.

Push Notifications

The destination automatically forwards push notification tokens through to Adjust.

Event Buffering

By default, our destination enables event buffering for Adjust. This saves your customers’ battery life. However, you can disable this in the options on the Adjust destination settings on Segment.

Deep Linking

The destination does not automatically support deep linking out of the box (you’d need to write code here regardless!). This means you can use Adjust’s deep-linking by accessing the Adjust SDK directly.


Supported Sources and Connection Modes

WebMobileServer
📱 Device-based
☁️ Cloud-based

To learn more about about Connection Modes and what dictates which we support, see here.

Segment offers an optional Device-based Connection Mode for Mobile data with Adjust. If you’d like to use those features that require client-based functionality, follow the steps above to ensure you have packaged the Adjust SDK with Segment’s.

Settings

Segment lets you change these destination settings via your Segment dashboard without having to touch any code.

App Token

Your Adjust app token can be retrieved from your Adjust account in the app’s Settings.

Map Your Events to Custom Adjust Event Tokens

Enter your event on the left, and the Adjust custom event token to map into on the right. Adjust allows you to create custom events under Settings > Events, which have custom tokens. Adjust’s API only accepts those tokens, not arbitrary event names. Any unmapped events will not be sent to Adjust, since they require a mapped token.

Send to Production Environment on Adjust

This will send all your data to your production environment on Adjust. If unchecked, data will flow to your sandbox environment on Adjust.

Buffer and batch events sent to Adjust

Device Mode Only: This will save battery life by buffering and batching events sent to Adjust. But during development it’s nicer to see events come through immediately.

Track Attribution Data

Send Adjust Attribution data to Segment and other tools as a track call.


If you have any questions or see anywhere we can improve our documentation, please let us know or kick off a conversation in the Segment Community!