Use cases

This page demonstrates different useful queries that can be handled through the activities analytics API

Number of active users

Request object
{
    "date_ranges": [
        {
            "start_date": "2021-09-26T00:00:00",
            "end_date": "2021-10-28T23:59:59"
        }
    ],
    "dimensions": [],
    "metrics": [
         {
            "expression": "users"
        }
    ]
}
Response
 "report_view": {
    "items_per_page": 100,
    "total_items": 1,
    "columns_headers": [
        "users"
    ],
    "rows": [
        [
            114353272
        ]
    ]
}

Number of activities per day

Request object
{
    "date_ranges": [
        {
            "start_date": "2021-10-20T00:00:00",
            "end_date": "2021-10-28T23:59:59"
        }
    ],
    "dimensions": [
        {"name": "date_yyyymmdd"}
    ],
    "metrics": [
         {
            "expression": "sessions"
        }
    ]
}
Response
  "report_view": {
    "items_per_page": 100,
    "total_items": 9,
    "columns_headers": [
        "date_yyyymmdd",
        "sessions"
    ],
    "rows": [
        [
            "20211020",
            1372624
        ],
        [
            "20211021",
            1368085
        ],
        ...
    ]
}

Values of a dimension

Request object
{
    "date_ranges": [
        {
            "start_date": "2021-10-20T00:00:00",
            "end_date": "2021-10-28T23:59:59"
        }
    ],
    "dimensions": [
        {"name": "type"}
    ],
    "metrics": [
    ]
}
Response
"report_view": {
    "items_per_page": 100,
    "total_items": 4,
    "columns_headers": [
        "type"
    ],
    "rows": [
        [
            "DISPLAY_AD"
        ],
        [
            "SITE_VISIT"
        ],
        [
            "USER_SCENARIO_NODE_ENTER"
        ],
        [
            "USER_SCENARIO_NODE_EXIT"
        ]
    ]
}

Active users and the revenue per day per device form factor on a specific channel

Request object
{
    "date_ranges": [
        {
            "start_date": "2021-10-20T00:00:00",
            "end_date": "2021-10-28T23:59:59"
        }
    ],
    "dimensions": [
        {"name": "date_yyyymmdd"},
        {"name": "device_form_factor"}
    ],
     "dimension_filter_clauses": {
        "operator": "AND",
        "filters": [
            {
                "dimension_name": "channel_id",
                "operator": "EXACT",
                "not": false,
                "expressions": [
                    "666"
                ]
            }
        ]
    },
    "metrics": [
        {"expression": "users"},
        {"expression": "revenue"}
    ]
}
Response
"report_view": {
    "items_per_page": 100,
    "total_items": 54,
    "columns_headers": [
        "date_yyyymmdd",
        "device_form_factor",
        "users",
        "revenue"
    ],
    "rows": [
        [
            "20211020",
            "OTHER",
            141,
            222.74
        ],
        [
            "20211020",
            "PERSONAL_COMPUTER",
            821923,
            87656567.1
        ],
        [
            "20211020",
            "SMART_TV",
            11,
            null
        ]
        [
            "20211020",
            "SMARTPHONE",
            1901978,
            98435875.79
        ],
        ...
    ]
}
                

More use cases

You can create any use case you want using the list of dimensions and metrics that are available.

Last updated