KPI Call

In the examples below, be sure to read all comments for additional relevant information.

KPI Call

{
    "resultType": "DATA_ONLY",
    "queryObject": {
        "type": "KPI",
        "metricName": "pages_pageImpressions",
        "dimensionName": "time_days",
        "predefinedContainer": {
            "filters": [
                {
                    "name": "time_range",
                    "connector": "AND",
                    "filterPredicate": "BETWEEN",
                    "value1": "2020-10-14 00:00:00",
                    "value2": "2020-11-11 00:00:00",
                    "context": "NONE",
                    "caseSensitive": false
                }
            ],
            "containers": []
        }
    }
}
CODE

KPI Response

Sample KPI response

{
    "calculationDataType": "RAW_DATA", 
    "rows": [
        [
            "0000000000", // 
            1306 // -> page Impressions
        ]
    ],
    "rowCount": 1,
    "rowCountTotal": 1,
    "headers": [
        {
            "alias": "time_id_categories_t_year_month_day|0",
            "arrangeType": "time_id_categories_t_year_month_day",
            "sumPositions": [
                0
            ],
            "name": "time_days",
            "metric": false,
            "dimension": true
        },
        {
            "alias": "page_impressions|0",
            "arrangeType": "page_impressions",
            "name": "pages_pageImpressions",
            "metric": true,
            "dimension": false,
            "sortIndex": 1, 
            "sortDirection": "DESCENDING"
        }
    ],
    "columnCount": 2,
    "warnings": [],
    "information": [],
    "timerange": [
        "2020-10-14 00:00:00",
        "2020-11-11 00:00:00"
    ],
    "timestamp": "2022-10-18T15:35:45.404+0200"
}
CODE


KPI Comparison Call

KPI Comparison Call

{
    "resultType": "DATA_ONLY",
    "queryObject": {
        "type": "KPI",
        "metricName": "pages_pageImpressions",
        "dimensionName": "time_days",
        "predefinedContainer": {
            "filters": [
                {
                    "name": "time_range",
                    "connector": "AND",
                    "filterPredicate": "BETWEEN",
                    "value1": "2020-10-14 00:00:00",
                    "value2": "2020-11-11 00:00:00",
                    "context": "NONE",
                    "caseSensitive": false
                }
            ],
            "containers": []
        },
        "comparison": {
            "type": "PERIOD",
            "filter": {
                "name": "time_range",
                "value1": "2022-03-02 00:00:00",
                "value2": "2022-03-06 00:00:00",
                "filterPredicate": "BETWEEN",
                "connector": "AND",
                "context": "NONE",
                "caseSensitive": false
            }
    }
}
}
CODE

KPI Comparison Response

Sample KPI Comparison Response

{
    "calculationDataType": "RAW_DATA",
    "rows": [
        [
            "000000000"  // -> Total row indication
			1306,  	// -> Page Impressions KPI time range
            1502 	// -> Page Impressions comparison time range
        ]
    ],
    "rowCount": 1,
    "rowCountTotal": 1,
    "headers": [
        {
            "alias": "time_id_categories_t_year_month_day|0",  // -> Dimension Column for position of TOTAL (footer)
            "arrangeType": "time_id_categories_t_year_month_day",
            "sumPositions": [
                0
            ],
            "name": "time_days",
            "metric": false,
            "dimension": true
        },
        {
            "alias": "page_impressions|0",		// -> Page Impressions KPI time range
            "arrangeType": "page_impressions", 
            "name": "pages_pageImpressions",
            "metric": true,
            "dimension": false,
            "sortIndex": 1,
            "sortDirection": "DESCENDING"
        },
        {
            "alias": "page_impressions|1",		// -> Page Impressions comparison time range
            "arrangeType": "page_impressions",
			"name": "pages_pageImpressions",
            "metric": true,
            "dimension": false
        }
    ],
    "columnCount": 3,
    "warnings": [],
    "information": [],
    "timerange": [
        "2020-10-14T00:00:00.000+0200",
        "2020-11-11T00:00:00.000+0100"
    ],
    "timestamp": "2022-10-19T10:03:21.351+0200"
}
CODE


Sparkline Call

Sparkline Call

{
    "resultType": "DATA_ONLY",
    "queryObject": {
        "type": "SPARKLINE",
        "metricName": "pages_pageImpressions",
        "dimensionName": "time_days",
        "predefinedContainer": {
            "filters": [
                {
                    "name": "time_range",
                    "connector": "AND",
                    "filterPredicate": "BETWEEN",
                    "value1": "2020-10-14 00:00:00",
                    "value2": "2020-11-11 00:00:00",
                    "context": "NONE",
                    "caseSensitive": false
                }
            ],
            "containers": []
        }
    }
}
CODE

Sparkline Response

Sample Sparkline Response

{
    "calculationDataType": "RAW_DATA",
    "rows": [ // -> Sparkline Data Points
        [
            "20201014",
            408
        ],
        [
            "20201015",
            148
        ],
        ...
        [
            "0000000000",
            1306
        ]
    ],
    "rowCount": 29,
    "rowCountTotal": 28,
    "headers": [
        {
            "alias": "time_id_categories_t_year_month_day|0",   
            "arrangeType": "time_id_categories_t_year_month_day",
            "sumPositions": [
                28
            ],
            "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
        }
    ],
    "columnCount": 2,
    "information": [],
    "warnings": [],
    "timerange": [
        "2020-10-14 00:00:00",
        "2020-11-11 00:00:00"
    ],
    "timestamp": "2022-10-18T15:31:31.871+0200"
}
CODE