The Mixpanel backends provides mixpanel events as cubes and event properties as dimensions.
Features:
two measure aggregates: total and unique
two derived measure aggregates: total_sma and unique_sma (simple moving average)
aggregation at year or top level
drill-down without the time dimension (approximation)
list of facts
Type is mixpanel
To obtain your API key log-in to the Mixpanel, go to Account, then Projects – you will see a list of key/secret pairs for your projects.
Example:
[datastore]
type: mixpanel
api_key: 0123456789abcdef0123456789abcdef
api_secret: 0123456789abcdef0123456789abcdef
Mixpanel backend generates the model on-the-fly. You have to specify that the provider is mixpanel not the static model file itself:
{
"name": "mixpanel",
"provider": "mixpanel"
}
It is possible to customize various properties of a cube or a dimension. The customizable properties are: name, label, description, category and info.
For example to customize search engine dimension:
"dimensions": [
{
"name": "search_engine",
"label": "Search Engine",
"description": "The search engine a user came from"
}
]
The list of dimensions can be limited by using a browser option allowed_dimensions or denied_dimensions:
Following will allow only one dimension:
"browser_options": {
"allowed_dimensions": "search_engine"
}
The browser_options can be specified at the model level – applies to all cubes, or just at a cube level – applies only to that cube.
By default dimension names are the same as property names. If a property name contains a special character such as space or $ it is replaced by a underscore. To use a different, custom dimension name add the dimension-to-property mapping:
"mappings": {
"city": "$city",
"initial_referrer": "$initial_referrer"
}
And define the dimension in the model as above.
Built-in dimension models with simplifiend name and with labels:
By default, cube names are the same as event names. To use a custom cube name add a mapping for cube:CUBENAME:
"mappings": {
"cube:campaign_delivery": "$campaign_delivery"
}
Create a slicer.ini:
[workspace]
model: model.json
[datastore]
type: mixpanel
api_key: YOUR_API_KEY
api_secret: YOUR_API_SECRET
[server]
prettyprint: true
Create a model.json:
{
"provider": "mixpanel"
}
Run the server:
slicer serve slicer.ini
Get a list of cubes:
curl "http://localhost:5000/cubes"
Important
It is not possible to specify a cut for the time dimension at the hour level. This is the Mixpanel’s limitation – it expects the from-to range to be at day granularity.