Time Series (Analysis variant)
  • 7 Minutes to read
  • Dark
    Light

Time Series (Analysis variant)

  • Dark
    Light

Article summary

The Time series view shows the development of chosen dimension values over time.

Activating the Time series and copying the configuration

  1. In an analysis, click on the Time series symbol.

  2. Configure the time series.

  3. Finish the configuration by clicking on „Apply“.

  4. Click “Copy JSON configuration”.

The configuration contains parts of other analysis variants configurations. For example, the Time Series configuration below contains sorting information on Page Impressions and Visits, which is only relevant for the list view. All other analysis variant-specific configurations are part of the viewMode property. Time series relevant metrics are identified by the property inTimeSeries: true.

Example Call

{
    "resultType": "DATA_ONLY",
    "queryObject": {
        "columns": [
            {
                "name": "pages",
                "scope": "OBJECT",
                "context": "PAGE",
                "variant": "NORMAL",
                "lowerLimit": 1,
                "upperLimit": 20
            },
            {
                "name": "pages_pageImpressions",
                "columnPeriod": "ANALYSIS",
                "sortDirection": "DESCENDING",
                "sortIndex": 1,
                "scope": "OBJECT",
                "context": "PAGE",
                "variant": "NORMAL",
                "inTimeSeries": true
            },
            {
                "name": "visits",
                "columnPeriod": "ANALYSIS",
                "scope": "OBJECT",
                "context": "SESSION",
                "variant": "NORMAL",
                "inTimeSeries": true
            },
            {
                "name": "pages_durationAvg",
                "columnPeriod": "ANALYSIS",
                "scope": "OBJECT",
                "variant": "NORMAL"
            },
            {
                "name": "visits_bounceRate",
                "columnPeriod": "ANALYSIS",
                "scope": "OBJECT",
                "variant": "NORMAL"
            },
            {
                "name": "pages_exitRate",
                "columnPeriod": "ANALYSIS",
                "scope": "OBJECT",
                "variant": "NORMAL"
            }
        ],
        "viewMode": {
            "active": "timeSeries",
            "timeSeries": {
                "timeName": "time_days",
                "values": [
                    "Search",
                    "Home",
                    "Cart"
                ],
                "top": 3,
                "viewType": "top"
            }
        },
        "variant": "LIST",
        "predefinedContainer": {
            "filters": [
                {
                    "name": "time_range",
                    "filterPredicate": "BETWEEN",
                    "connector": "AND",
                    "caseSensitive": false,
                    "context": "NONE",
                    "value1": "2023-02-27 00:00:00",
                    "value2": "2023-03-27 00:00:00"
                }
            ],
            "containers": []
        }
    }
}

Example Response

Due to the nature of this analysis variant, the request and response columns differ. The time series response is a non-time dimension-based analysis transformed into a time-based analysis, with metrics filtered by the selected time series dimension values. For example, a page analysis with selected time series values "Page A" and "Page B" with Visits on Days becomes a "Days" analysis, with one Visit metric filtered on "Page A" and another Visit metric filtered on "Page B".

Important Properties

Individual metrics need to be grouped in order to construct a proper table from the result. Imagine the request contains two metrics, and you must determine which request column belongs to which metric. For this purpose, the groupBy and groupByIndex properties have been added.

groupBy

  • The base metric is determined by the alias, not the name. The request could contain metrics with identical names or identical arrange types, requiring the alias to have an index.

groupByIndex

  • Determines the column position within the base metric

Example Response

From this example, Page Impressions will be given the alias "page_impressions".  You can see which columns are grouped under Page Impressions by looking for "groupBy": "page_impressions|0". The groupByIndex shows the order of the columns, so Search is "groupByIndex": 0, Home is "groupByIndex": 1, and Cart is "groupByIndex": 2.

{
    "calculationDataType": "RAW_DATA",
    "rows": [
        [
            "20230227",
            230,
            173,
            113,
            230,
            171,
            113
        ],
        [
            "20230228",
            229,
            164,
            111,
            229,
            162,
            111
        ],
..
        [
            "20230229",
           	339,
            475,
            135,
            379,
            333,
            1095
        ]
    ],
    "rowCount": 28,
    "rowCountTotal": 28,
    "headers": [
        {
            "alias": "time_id_categories_t_year_month_day|0",
            "arrangeType": "time_id_categories_t_year_month_day",
            "name": "time_days",
            "metric": false,
            "dimension": true,
            "sortIndex": 1,
            "sortDirection": "ASCENDING"
        },
        {
            "alias": "page_impressions|0",
            "arrangeType": "page_impressions",
            "name": "pages_pageImpressions",
            "metric": true,
            "dimension": false,
            "viewModeDimension": "pages",
            "viewModeDimensionValue": "search",
            "groupByIndex": 0,
            "groupBy": "page_impressions|0"
        },
        {
            "alias": "page_impressions|1",
            "arrangeType": "page_impressions",
            "name": "pages_pageImpressions",
            "metric": true,
            "dimension": false,
            "viewModeDimension": "pages",
            "viewModeDimensionValue": "home",
            "groupByIndex": 1,
            "groupBy": "page_impressions|0"
        },
        {
            "alias": "page_impressions|2",
            "arrangeType": "page_impressions",
            "name": "pages_pageImpressions",
            "metric": true,
            "dimension": false,
            "viewModeDimension": "pages",
            "viewModeDimensionValue": "cart",
            "groupByIndex": 2,
            "groupBy": "page_impressions|0"
        },
        {
            "alias": "visits|0",
            "arrangeType": "visits",
            "name": "visits",
            "metric": true,
            "dimension": false,
            "viewModeDimension": "pages",
            "viewModeDimensionValue": "search",
            "groupByIndex": 0,
            "groupBy": "visits|0"
        },
        {
            "alias": "visits|1",
            "arrangeType": "visits",
            "name": "visits",
            "metric": true,
            "dimension": false,
            "viewModeDimension": "pages",
            "viewModeDimensionValue": "home",
            "groupByIndex": 1,
            "groupBy": "visits|0"
        },
        {
            "alias": "visits|2",
            "arrangeType": "visits",
            "name": "visits",
            "metric": true,
            "dimension": false,
            "viewModeDimension": "pages",
            "viewModeDimensionValue": "cart",
            "groupByIndex": 2,
            "groupBy": "visits|0"
        }
    ],
    "columnCount": 7,
    "information": [],
    "warnings": [],
    "timerange": [
        "2023-02-27 00:00:00",
        "2023-03-27 00:00:00"
    ],
    "timestamp": "2023-03-27T18:51:03.744+0100"
}


Was this article helpful?