---
title: Configure Localytics
slug: feature-experimentation/docs/set-up-localytics
docTags: 
createdAt: 2026-08-05T20:39:58.000Z
---

:::hint{type="info"}
This is a third-party integration and is not an Optimizely subprocessor. See Optimizely's [Third-Party Add-Ons & Platform Integration Terms](https://www.optimizely.com/legal/third-party-add-ons-platform-integration-terms/).
:::

:::hint{type="warning"}
This integration uses API behavior that has changed for SDK versions 3.0+. If you encounter any issues, [contact Optimizely Support](https://support.optimizely.com/hc/en-us/articles/4410284179469).
:::

Localytics offers more than one option for capturing Optimizely Feature Experimentation test information. The code examples demonstrate the [Custom Events with Attributes](https://help.uplandsoftware.com/localytics/help/_Analytics/How%20Localytics%20understands%20data.htm#Events) option in this suggested integration. For information and alternative solutions, see the following sections:

## Android

The example code has two parts:

- Add a `TrackNotificationListener` listener for `onEvent` to wrap `Localytics.tagEvent()`.
- Add `OptimizelyClient.track()` to track conversions.

Instead of calling `Localytics.tagEvent()` directly, wrap the calls with `OptimizelyClient.track()` to include bucketing information as event attributes.

The example code demonstrates how to add a track event listener. Each `OptimizelyClient.track()` event tracking retrieves a mapping of experiment key to variation key from `UserProfile`, which records bucketing decisions. Next, the code calls `Localytics.tagEvent()` and includes the bucketing map among the attributes.

The last step is to add `OptimizelyClient.track()` to track event conversions.

### Consistent user identity

Maintaining a consistent user identity across multiple sessions and devices can help ensure proper reporting. Localytics provides some [guidelines](https://help.uplandsoftware.com/localytics/dev/android.html#identifying-users-android) for their platform.

You should using the same user ID with these methods:

- `optimizelyClient.activate()`
- `Localytics.setCustomerId()`

### Alternative solution

Another solution is to set Localytics' [Custom Dimensions](https://help.uplandsoftware.com/localytics/help/_Analytics/How%20Localytics%20understands%20data.htm?Highlight=custom%20dimensions#Dimensio) using an `ActivateNotificationListener`. Custom dimensions can be used to segment users without needing to wrap `Localytics.tagEvent()`, but they require configuration in the Localytics dashboard for each Optimizely test.

```java
import com.localytics.android.Localytics;
import com.optimizely.ab.bucketing.UserProfile;
import com.optimizely.ab.notification.NotificationListener;
import com.optimizely.ab.notification.TrackNotificationListener;
import java.util.Map;

optimizelyManager.getOptimizely().getNotificationCenter().addNotificationListener(NotificationCenter.NotificationType.Track, new TrackNotificationListener() {
 @Override
  public void onTrack(String eventKey, String userId, Map<String, ?> attributes, Map<String, ?> eventTags, LogEvent event) {
    // Make a copy of attributes because it could be immutable
    Map<String, ?> attr = new HashMap<>(attributes);

    // Tag custom event with attributes
    Localytics.tagEvent("[Optimizely] " + eventKey, attr);
  }
});

// Track a conversion event for the provided user
optimizelyClient.track(eventKey, userId);
```

## Compare results

When comparing Optimizely and Localytics results, remember to apply a date filter in Localytics that corresponds with the dates your Optimizely test was running.

## Unsupported Platforms

Optimizely does not have a suggested solution for integrating Localytics with Optimizely's SDKs for these platforms:

- Agent
- Go
- C#
- Java
- JavaScript
- Node
- PHP
- Python
- Ruby
