Developer
User guidesDeveloper websiteHelp centerLog in
  • Welcome!
  • Organisations structure
    • Datamart
    • Users and roles
  • User points
    • User identifiers
      • Networks IDs
        • Device-based Network IDs
          • Custom Device ID integration
          • ID5
          • First ID
        • User-based Network IDs
          • Custom User ID integration
          • UTIQ martechpass
      • Accounts
      • Emails
      • Device identifiers
    • User activities and events
    • Compartments
    • User profiles
    • User segments
    • Hyper point & Quarantine
  • Data model
    • Defining your schema
    • Computed fields
      • Concepts
      • Setup
      • Development
      • Examples
  • Data ingestion
    • Real time user tracking
      • Website tracking
      • Mobile apps tracking
      • Ads exposure tracking
      • AMP tracking
      • Conversions tracking
      • Email views and clicks
      • Tracking API
      • Event rules
      • Activity analyzers
    • Bulk processing
      • Imports
        • User activities import
        • User profiles import
        • User choices import
        • Segments import
      • Deletions
        • User identifiers deletion
        • Device points deletion
        • User points deletion
      • User identifiers association
      • Integration batch
    • Activities analytics
    • Data warehouse
      • Preliminary setup
        • BigQuery
      • Create data warehouse
  • Querying your data
    • OTQL queries
    • OTQL examples
    • GraphQL queries
    • UserPoint API
    • User activities
    • Activities analytics queries
      • API Quickstart
      • Dimensions and metrics
      • Use cases
    • Funnel API
  • Alerting
    • Alert configurations
  • Data visualisation
    • Quickstart
    • Dashboards
    • Sections and cards
    • Charts
    • Datasets and data sources
      • Using a data file data source
    • Transformations
    • Filters
    • Cookbook
    • Reference
  • Advanced usages
    • Audience segmentation
      • Audience features
      • Segment builders
      • Audience segment metrics
      • Audience segment feed
        • Building new feeds
        • Monitoring a feed
        • Curated Audiences (SDA)
      • Edge segments
      • Cohort-based Lookalike
    • Contextual targeting
      • Setup
      • Activation
        • Google Ad Manager
        • Xandr (through prebid.js)
      • API documentation
    • Exporting your data
      • Query Exports
      • Datamart replication
    • Data privacy compliance
      • User choices
      • Cleaning rules
      • Exercise of user rights
      • Cookies
    • Campaigns
    • Automations
      • Email routers
      • Email renderers
      • Opt-in provider
      • Custom action plugins
      • Usage limits for automations
    • Plugins
      • Concepts
      • Creation & Deployment
      • Coding your plugin
      • Manage existing plugins
      • Layouts
      • Presets
      • Monitoring
      • Throttling
      • Batching (for external feeds)
    • Platform monitoring
      • Resources usage
        • Dimensions and metrics
      • Collection volumes
        • Dimensions and metrics
      • Events ingestion monitoring
        • Dimensions and metrics
    • Data Clean Room
      • Bunker
      • Clean room
  • Resources
    • Tutorial: Data Ingestion
      • Your first events
        • Add the mediarithmics tag
          • Getting the tag
          • Adding the tag
        • Send events using the tag
          • Adding event properties
          • Finding the UserEvent type in your schema
          • Matching your schema
          • Standard events
      • Your first bulk imports
        • API basics
          • Authentication
          • Your first API call
        • Send documents using the API
          • Requirements
          • Sending documents
    • Using our API
      • Authentication
    • Tools & libraries
      • mics CLI
      • JS Tag
      • Plugin SDK
    • Data cubes
      • Creating a report
      • Reference
Powered by GitBook
On this page
  • Upload your raw data in the platform
  • Key / value dataset
  • Number dataset
  • Reference this file in your charts

Was this helpful?

Export as PDF
  1. Data visualisation
  2. Datasets and data sources

Using a data file data source

You can use raw data stored in a file using the data_file datasource.

It works this way :

  1. You upload a data file in the platform using the data_file API

  2. You reference this file in the dashboard as a dataset

  3. This source can then be transformed and display like all other data sources.

Upload your raw data in the platform

Use the data_file API to upload any JSON file containing your raw data. Its structure is not fixed.

Sample JSON
  {
      "id": "1",
      "name": "Demographics",
      "other_metadata_as_you_wish": "SEGMENT",
      "genders": [
          {
            "key": "male",
            "value": 358
          },
          {
            "key": "female",
            "value": 66
          }
      ],
      "ages": [
        {
          "key": "18-24",
          "count": 277
        },
        {
          "key": "45-54",
          "count": 8
        },
        {
          "key": "65+",
          "count": 9
        },
        {
          "key": "25-34",
          "count": 12
        },
        {
          "key": "35-44",
          "count": 9
        },
        {
          "key": "55-64",
          "count": 3
        }
    ],
    "total": 666
}

There are two types of datasets that you can use :

Key / value dataset

A default key / value dataset is an array of key / value objects.

{
    "key_value_dataset": [
        {
            "key": "Dimension 1",
            "value": 666
        }
        ...
        {
            "key": "Dimension X",
            "value": 999
        }
    ]
}

The value property could be named differently, such as count or value-1 by using the series_title property of the data source.

Number dataset

{
    ...
    "total": 666
}

Reference this file in your charts

The whole structure of the dashboard is exactly the same as with other data sources.

The data source declaration is :

{
      "type": "data_file",
      // URI of the JSON data file containing data
      // Format "mics://data_file/tenants/1426/dashboard-1.json"
      "uri": String,
      // Path of the property in the JSON that should be used as dataset
      // This allows you to have multiple datasets in the same JSON file
      // Should use the JSONPath syntax. See https://jsonpath.com/
      // For example, "$[0].components[1].component.data"
      "JSON_path": String,
      // Optional. Title of the series for tooltips and legends
      "series_title": String
}

Here is an example with the JSON file we used previously

{
    "sections": [
        {
            "title": "Section",
            "cards": [
                {
                    "x": 0,
                    "charts": [
                        {
                            "title": "Gender",
                            "type": "Bars",
                            "dataset": {
                                "type": "data_file",
                                "uri": "mics://data_file/tenants/XXX/dashboard-1.json",
                                "JSON_path": "$.genders"
                            }
                        }
                    ],
                    "y": 0,
                    "h": 3,
                    "layout": "vertical",
                    "w": 4
                },
                {
                    "x": 4,
                    "charts": [
                        {
                            "options": {
                                "legend": {
                                    "enabled": true,
                                    "position": "right"
                                }
                            },
                            "dataset": {
                                "type": "data_file",
                                "uri": "mics://data_file/tenants/XXX/dashboard-1.json",
                                "JSON_path": "$.ages",
                                "series_title": "count"
                            },
                            "title": "Age range",
                            "type": "Pie"
                        }
                    ],
                    "y": 0,
                    "h": 3,
                    "layout": "vertical",
                    "w": 5
                },
                {
                    "x": 9,
                    "charts": [
                        {
                            "title": "Totals",
                            "type": "Metric",
                            "dataset": {
                                "type": "data_file",
                                "uri": "mics://data_file/tenants/XXX/dashboard-1.json",
                                "JSON_path": "$.total"
                            }
                        }
                    ],
                    "y": 0,
                    "h": 3,
                    "layout": "vertical",
                    "w": 3
                }
            ]
        }
    ]
}

You can use a {SEGMENT_ID} token in uri and/or JSON_path properties. It will be replaced by the current segment if the dashboard is loaded on a segment's page. If the dashboard is loaded at any other scope, the token will not be replaced.

PreviousDatasets and data sourcesNextTransformations

Last updated 3 years ago

Was this helpful?

For more information on datasets and datasources, see .

For a quick start on how to upload a dashboard, see .

Quickstart
Datasets and data sources