Adjust Destination

Destination Info
Components
Connection Modes
Device-mode Cloud-mode
Web Web
Mobile Mobile
Server Server

Adjust is the mobile attribution provider of choice for hundreds of organizations across the globe. They unify all your marketing activities into one powerful platform, giving you the insights you need to scale your business. The Adjust Destination is open-source. You can browse the code on GitHub for iOS and Android.

If you notice any gaps, out-dated information, or want to leave feedback to help improve Segment’s documentation, let us know.

Getting started

  1. From the Segment web app, click Catalog.
  2. Search for “Adjust” in the Catalog, select it, and choose which of your sources to connect the destination to.
  3. You don’t need to include Adjust’s SDK natively, as this prevent you from successfully implementing the Adjust.
  4. Depending on the source you’ve selected, include Adjust’s library by adding the following lines to your dependency configuration.

iOS

Note: The Adjust SDK requires these frameworks from Apple to enable advanced features like attribution. For best results, add these frameworks to your application.

If you are using iOS, add this line to your CocoaPods Podfile:

pod "Segment-Adjust"

After adding the dependency, you must register the destination with Segment’s 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];

In cases where the Adjust integration sometimes does not track the install attribution properly, you can configure a delay for the Adjust reporting to ensure all session parameters have been loaded properly. You can configure this using Segment’s UI by enabling setDelay and providing a delayTime in seconds. Segment then calls the Adjust iOS SDK’s configuration to set a delay. The maximum delay start time of the Adjust SDK is 10 seconds.

Additional device-mode set up for iOS 14 support

Segment’s Adjust SDK was updated to use Adjust version 4.23.0 to prepare for iOS 14. The updated Adjust SDK offers iOS 14 support, AppTrackingTransparency (ATT) and SKAdNetwork dashboard features.

See Adjust’s Steps to Support iOS 14 documentation for more information.

To use the latest Adjust SDK to collect IDFAs, you must do the following:

  1. Upgrade to use Xcode12.
  2. Update your Segment Adjust SDK to version 3.0.0 or later. The latest SDK has integrated support for the SKAdNetwork, which is enabled by default. For access to the SKAdNetwork, make sure your ad networks are registered with Apple. Adjust automatically registers for SKAdNetwork attribution on SDK initialization, and can handle the conversion value update.
  3. Import and implement the AppTrackingTransparency (ATT) Framework. Navigate to your project Info.plist and add a “Privacy - Tracking Usage Description”. This description appears in a popup when the application initializes in iOS 14. Users are prompted to indicate whether or not they want to allow tracking.
  4. Launch an opt-in popup using Adjust’s SDK wrapper, built on top of requestTrackingAuthorizationWithCompletionHandler for the ATT Framework. An iOS pop-up launches when the wrapper is called the first time. When it is called again, the wrapper retrieves the tracking authorization status, which is sent to the Adjust backend. Adjust relays the information directly to you. The example below shows how to use this wrapper.

    [Adjust requestTrackingAuthorizationWithCompletionHandler:^(NSUInteger status) {
        switch (status) {
            case 0:
                // ATTrackingManagerAuthorizationStatusNotDetermined case
                break;
            case 1:
                // ATTrackingManagerAuthorizationStatusRestricted case
                break;
            case 2:
                // ATTrackingManagerAuthorizationStatusDenied case
                break;
            case 3:
                // ATTrackingManagerAuthorizationStatusAuthorized case
                break;
      }];
    
  5. Follow Segment’s guide for collecting IDFA

Android

If you are using Android, add this line to your gradle file:

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

After adding the dependency, you must register the destination with Segment’s 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, Segment automatically starts translating and sending your data to Adjust.

Server

The Cloud-mode integration allows you to send supplemental data to Adjust. This does not include attribution events. If you rely on the Adjust server-side component, and do not bundle the Segment-Adjust SDK, your installs will not be attributed. E-commerce events and other general track events are supported out of the box. You must map your track events to your custom Adjust Event Token in your Adjust destination settings.

Additionally, to send any 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'
    }
  }
});

For iOS and Android, Device ID and Advertising ID map to Segment as follows:

Segment iOS Android
context.device.advertisingId idfa gps_adid
context.device.id idfv android_id

Identify

If you’re not familiar with the Segment Specs, take a look to understand what the Identify method does. An example call would look like:

analytics.identify('12091906-01011992', {
  name: 'Grace Hopper',
  email: 'grace@usnavy.gov'
});

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.

Track

If you’re not familiar with the Segment Specs, take a look to understand what the Track method does. An example call would look like:

analytics.track('Article Completed', {
  title: 'How to Create a Tracking Plan',
  course: 'Intro to Analytics',
});

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. Segment includes 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 Segment’s spec’d properties.

Install Attributed

Client

Segment will trigger an Install Attributed event if you have trackAttributionData enabled in your settings and the Segment-Adjust integration 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:

Key Value Description
provider Adjust hardcoded by Segment
trackerToken attribution.trackerToken the tracker token of the current install
trackerName attribution.trackerName the tracker name of the current install
campaign.source attribution.network the network grouping level of the current install
campaign.name attribution.campaign the campaign grouping level of the current install
campaign.content attribution.clickLabel the click label of the current install
campaign.adCreative attribution.creative the creative grouping level of the current install
campaign.adGroup attribution.adgroup the ad group grouping level 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.

Troubleshooting

If you are also loading Adjust’s SDK natively in addition to loading using the Segment-Adjust integration, Install Attributed event callback will likely be affected/unable to be triggered. Remove native Adjust implementation.

Since there will not be a change in attribution for registered testing devices you are currently using to send data to Adjust, you will need to unregister that device in Adjust.

To do so:

  1. Take note of the IDFA/advertisingId (you can find this in the raw view of an event in your Segment debugger)
  2. Uninstall the app from your device
  3. Delete the IDFA/advertisingId from Adjust’s testing console.
  4. Re-install the app on the device. You should now see the device register in Adjust and an Install Attributed triggered.

Server

Unlike the Device-mode option to send Install Attributed to Segment, the Cloud-mode option will not include device context information nor will it be sent to enabled device mode destinations.

If you are bundling the Segment-Adjust integration and would like attribution data sent from Adjust’s servers back to Segment, you can enable Segment as a Special Partner in Adjust. Once set up, Install Attributed will be sent to Segment, and on to enabled Cloud-mode destinations.

Contact the Adjust team at support@adjust.com for questions related to enabling Segment as a Adjust Special Partner.

Additional features

Environments

By default, Segment’s 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 and 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.

Segment supports setting these Partner Parameters. Be sure you are pulling in the minimum versions for iOS 1.1.0 and Android 0.3.0.

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.

Duplicate purchase events

If you’re using Adjust’s iOS SDK, it will automatically takes care of duplicate purchase events. Segment uses Adjust’s default deduplication (using transactionId) when you send an orderId (see the ecommerce spec).

In-app purchase receipts

The destination does not currently support in-app purchase receipts. If this is important to you, reach out to support.

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.

Engage

You can send computed traits and audiences generated using Engage to this destination as a user property. To learn more about Engage, schedule a demo.

For user-property destinations, an identify call is sent to the destination for each user being added and removed. The property name is the snake_cased version of the audience name, with a true/false value to indicate membership. For example, when a user first completes an order in the last 30 days, Engage sends an Identify call with the property order_completed_last_30days: true. When the user no longer satisfies this condition (for example, it’s been more than 30 days since their last order), Engage sets that value to false.

When you first create an audience, Engage sends an Identify call for every user in that audience. Later audience syncs only send updates for users whose membership has changed since the last sync.

Real-time to batch destination sync frequency

Real-time audience syncs to Adjust may take six or more hours for the initial sync to complete. Upon completion, a sync frequency of two to three hours is expected.

Settings

Segment lets you change these destination settings from the Segment app without having to touch any code.

Setting Description
App Token
(required)
string. Your Adjust app token can be retrieved from your Adjust account in the app’s Settings.
Map Your Events to Custom Adjust Event Tokens text-map, defaults to {}.

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.
delayTime number, defaults to 0.

You must enable setDelay first! Set the initial delay time in seconds with the setting setDelay enabled. The maximum delay start time of the adjust SDK is 10 seconds.
Send Event Creation Time boolean, defaults to FALSE .

Warning: enabling this setting will cause more events to be rejected by Adjust. When enabled, this will send the time the event was created to Adjust using unix timestamp formatting. Increased rejections are caused by [Adjust’s requirement][1] that events are received in chronological order (Segment does not guarantee chronological order). When disabled, the created_at time will be the time an event is received by Adjust. [1]: http://help.adjust.com/tracking/app-events/basic-event-setup/track-s2s-events#recommended-additional-parameters
setDelay boolean, defaults to FALSE .

Configure a delay to ensure all session parameters have been loaded properly. The max delay start time is 10 seconds.
Send to Production Environment on Adjust boolean, defaults to FALSE .

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 boolean, defaults to FALSE .

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 boolean, defaults to FALSE .

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

This page was last modified: 23 Oct 2023



Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
or
Create free account