Docs Data Segment

Segment integration

Combine your behavioral analytics with your financial data by connecting Mantle with Segment. This connection allows you to send app activity and customer events to your Segment dashboard, giving you a detailed and consolidated view of your customer events.

You can also send data from Segment to Mantle, allowing you to consolidate all of your customer usage data in one place.

Benefits of Usage Events in Mantle

By connecting Mantle with Segment, you can leverage various usage events to gain deeper insights and enhance your operations:

  • Customer insights: Track detailed customer interactions and behaviors in Mantle’s Customer View, alongside all other data, providing comprehensive visibility and powerful insights.
  • Enhanced reporting: Access consolidated usage data reports for better analysis.
  • Automated billing: Use usage data for automated billing processes, such as charging based on usage or triggering plan upgrades.
  • Custom metrics: Create custom metrics from usage events for comprehensive analysis.

Sending events from Segment to Mantle

Setting source and destination

To send usage events, you’ll need to configure:

After adding Mantle as the destination, you’ll be prompted to select the data source from which you want to send events:

Select data source for destination

Once you select your data source, you’ll be prompted to enter your Mantle API credentials to connect your Mantle account:

Add Mantle credentials to Segment

If you already have a Mantle App ID and API key, add them. If not, follow these steps to create one:

  1. Log into your Mantle account.
  2. Select the app for which you want to create an API key.
  3. Go to Settings.
  4. Click Add on the API keys card.

Once set up, your Segment connection screen should display your source connected to your Mantle account as the destination:

Segment connection screen

Mappings

Now that the source and destination are set, ensure you correctly map the fields between the two datasets so they match when being pushed.

Navigate to Destinations and click Mappings, from there click New Mapping.

Mapping configuration:

  1. Set the event type for the mapping to Track.
Segment connection screen
  1. The event field from the source should map automatically to Event Name for the destination.
  2. Map shop from the source (properties.shop) to Customer ID in Mantle to ensure correct customer matching.
  3. The messageid from the source should map automatically to Event ID.
Segment mappings

Once these mappings are set, send a test event at the bottom of the page to ensure everything is working correctly.

If the test event works, you should start seeing new events in your Mantle account under Usage metrics -> Usage events:

Usage events in Mantle

Sending events from Mantle to Segment

You can send several events to Segment, including customer installations, uninstalls, reactivations, and subscription changes:

CategoriesActivities
App activitiesCustomer installed app
Customer uninstalled app
Customer installation was deactivated/frozen
Customer installation was reactivated
Customer reviewed app
Subscription activitiesCustomer subscribed to plan
Customer unsubscribed from plan
Customer upgraded plan
Customer downgraded plan
Subscription was frozen
Subscription was unfrozen

Configuration steps

  1. Go to Settings -> Integrations and select Segment.
  2. Enter your unique Segment write key in the Write key section.
  3. Choose the specific apps that will trigger notifications.
  4. Save your configurations to activate the Segment notifications.
  5. (Optional) To send a custom field from Mantle as the user ID, check the box and select the custom field you want to use.
Segment integration interface

Once completed, the events you selected will be pushed to your Segment Source associated with the Write key you provided.