Last modified November 16, 2018 by Shelly Wolfe

Data mining with Swrve

This tutorial section serves as an introduction to analysis of Swrve export data. Swrve export data enables you to dig deeper into the the data provided in the Swrve dashboard. Examples are provided using Amazon Redshift as the data storage platform.

Why pull data from Swrve?

To motivate our work in data mining, it is worth understanding some of the reasons that Swrve customers pull data out of Swrve for data mining. Often they are trying to do things like:

  • LTV analysis
  • Churn analysis (for example, last actions before churning)
  • Custom segmentation (for example, building custom audiences)
  • Custom KPIs (for example, time to first purchase)

Each of these use cases are custom based on the unique requirements of their business and not something that is typically available without ad-hoc analysis capabilities.

New to data mining? Contact our Data Services team at

Your Swrve data

Your Swrve data is available from the following sources:

  • Raw event export data – the raw, unprocessed events your app sends us, in JSON format. This is the lowest level data available available from Swrve. These data export includes every action sent to the Swrve events APIs.
  • User database downloads – per-user records of current user state, in CSV format. This data is an export of the low level data used by Swrve segmentation. For more information on the User DB Downloads, see Intro to user databases.
  • Swrve Export APIs – enables you to download all of the KPIs, in CSV or JSON format. This is data that is available aggregated by segment. For more information about the Swrve Export APIs, see the Swrve Export API guide.
  • Dashboard chart downloads – enables you to download data from the dashboard charts.
Source Type Output format Granularity Use cases Prerequisites
Dashboard chart download Chart contents CSV Single Chart Custom reporting, custom charts None
Swrve Export APIs Aggregate KPI data CSV / JSON Single Segment Custom reporting, custom dashboards Command line, REST API
User DB downloads Per user segmentation data gzip CSV Single User User centric SQL queries, Deep-dive campaign analysis, Predictive analysis REST API, Command line, SQL
Raw event export Per user event data gzip JSON Single User event Event centric SQL queries, User behavior analysis REST API, Command line, SQL

While Swrve Export APIs and dashboard chart downloads are useful for answering questions, the data mining tutorials focus on using the data from the User DB downloads and raw event data sources. Combined, these two methods of data export allow for ad-hoc, deeper level queries into all the data being collected by the Swrve SDKs and APIs.

In these tutorials, you’ll set up an Amazon Redshift cluster, load Swrve event data into it, and run queries to answer detailed questions about your users. The data mining tutorials are ideal for data analysts and technical users who want more insight from the data they’ve already collected with Swrve.

A comprehensive approach to data involves using each of these data sources. For example, you can easily create custom internal daily dashboards using the data from the Swrve Export APIs, but if you need to go deeper into the behavior of ad-hoc groups of users, the raw event export and User DB downloads are required.

Next steps

Need a hosted solution?
Most Swrve customers can self-host this pipeline; all you have to do is follow the steps in these tutorials. However, if you require a turnkey hosted solution, we offer one as a professional service. There is an additional fee associated with this service. For more information, contact your CSM at
Need help with Queries?
Swrve support can help you with basic setup and configuration of the pipeline described above. If you need help with your queries, contact our Data Services team at They will help you get the most out of your data with dedicated support, pre-built and custom reports, and dedicated data science hours.