Localytics Destination

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

Our Localytics mobile 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 site or app, toggle Localytics on in your Segment destinations, and add your application’s App Key which you can find in your Localytics app settings. These new settings will take up to an hour to propogate to all of your existing users. For new users it’ll be instanteneous!

Note: Localytics does not accept server-side data, so you’ll have to use one of our client-side libraries (Analytics.js, iOS/Android SDKs with Localytics bundled to send data to Localytics.

You will also need to add the Maven Localytics repo (since Localytics doesn’t publish it on Maven Central). You can see an example of how to add that here.


Identify

When you call identify, we’ll set the Localytics customer Id, and set any special Localytics traits you provide, such as name, or email, and any custom traits as well.

Track

Whenever you call track, we’ll log an event with Localytics. track takes the name of the event and any optional properties you want to associate with the event.


Push Notifications

Push notifications on Android require a bit of extra work to setup.

  • First, you need to make sure Localytics is being bundled. You can find out more information about bundled integrations in our Android documentation.

  • Follow Localytics’ documentation to setup the permission in your AndroidManifest.xml. Specifically, the AndroidManifest changes regarding the GcmReceiver, GcmListenerService, InstanceIDListenerServer, and PushTrackingActivity classes.

  • In lieu of step four, you will register the Push receiver in your Activity or Application class within a Segment onIntegrationReady method:

@Override protected void onResume() {
    super.onResume();

     Analytics.with(this).onIntegrationReady(BundledIntegration.LOCALYTICS, new Callback() {
      @Override public void onIntegrationReady(Object integration) {
        Localytics.registerPush("YOUR-SENDER-ID");
      }
    });
}

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 Localytics SDK with Segment’s.

Settings

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

Custom Dimensions

Localytics only accepts custom dimensions that have been pre-set in your app. Make sure to set these up in Localytics first, under Settings > Apps and then editing your app settings. You should then map the trait in an identify call or the property in a track call to the corresponding custom dimension you want to send. For e.g. you might map gender with custom dimension 0. You can read more about custom dimensions here

Session Timeout Interval

If an App stays in the background for more than this many seconds, start a new session when it returns to foreground.

Use Organization Scope for Attributes

This allows a user to set the profileScope of attributes within Localytics to Organization. If this is enabled, the attributes that you set for a user will be available across all of your apps in Localytics. If it’s unchecked, we’ll use the default SDK behavior of Application scoping.

App Key

You can find your App Key in your Localytics Settings page.


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!