Apptimize Destination

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

Our Apptimize destination code is open sourced on Github. Feel free to check it out: iOS, Android.

Getting Started

Once the Segment library is integrated with your mobile app, toggle Apptimize on in your Segment dashboard, and fill in your Apptimize application key.

The Apptimize application key is a 31 character key, which you can find in your Apptimize app settings (https://apptimize.com/admin/settings/apps).

There is also an advanced setting to publish Apptimize experiment data to Segment.

The destination supports the identify, track, and screen methods. If you choose to automatically record screen events or track Application lifecycle events, these will also be reflected in Apptimize. You also have access to all normal Apptimize non-Segment functionality.

To integrate, simply pull in the destination as a dependency and include the Apptimize Integration Factory when setting up Segment Analytics.

In Android

Make you’ve added the Apptimize Maven repository.

maven { url 'http://maven.apptimize.com/artifactory/repo' }

Include the dependency through Gradle.

compile 'com.apptimize.segment:apptimize-segment-integration:+'

In code

Analytics analytics = new Analytics.Builder(context, "YOUR_WRITE_KEY_HERE")
  .use(ApptimizeIntegration.FACTORY)
  ...
  .build();

In iOS

Include the dependency through Cocoapods.

pod "Segment-Apptimize"

In code

SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"YOUR_WRITE_KEY_HERE"];
[config use:[SEGApptimizeIntegrationFactory instance]];
...
[SEGAnalytics setupWithConfiguration:config];

Identify

When you identify a user, Segment will pass that user’s information to Apptimize. The Segment userId field is passed to Apptimize as an Apptimize custom attribute called userId. Similarly Segment’s built-in traits appear in Apptimize as custom attributes, e.g. name, firstName, address. You can also define arbitrary traits of your choice. The destination will recognize integer attributes; all other traits will be sent as strings.

Track

When you track an event, the event will be marked in Apptimize as an occurence of an Apptimize event of the same name.

(Optional) You can also specify a value for each event, by adding a value property to the event when tracking. This is useful, for instance, when you want to track the price of orders each time a user clicks “Buy” in your app’s shopping cart.

  • value (5.23)

Screen

When you record a screen, Apptimize will track an event of the form Viewed [Screen name] screen. If you choose to automatically record screen events, they will appear in Apptimize in the above format.

Send Experiment Data from Apptimize

If the advanced setting Send experiment data to other tools (as a track call) is checked, we will automatically collect the event Experiment Viewed.

This event supports the following semantic properties:

PropertyType
experiment_nameString
variation_nameString

Manually Initialize Apptimize

Since the Apptimize Android and iOS destinations are initiazlied asynchronously by Segment, you can manually initialize Apptimize and run experiments without waiting for Segment to initialize for you. Note: Make sure that the Apptimize app key matches the key in the Segment dashboard.

For iOS: Set the plist property ‘ApptimizeAppKey’ to the corresponding app key for the app. Android: Use the Apptimize.setup) API to initialize Apptimize with the app key.

It is important to note that if the app keys in the plist/code and the Segment dashboard do not match, the SDK will use the app key from the plist/code as it finishes initialization first. While it is safe to initialize Apptimize multiple times in the app, to avoid confusion, be very careful that the app key is the same in both the places.


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.

This destination requires a Device-based Connection Mode for Mobile data. Follow the steps above to ensure you have packaged the Apptimize SDK with Segment’s.

Settings

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

App Key

You can find your App Key on the Apptimize settings page

Send experiment data to other tools (as a track call)

Sends the experiment and variation information as properties on 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!