---
title: "Get Campaign results"
method: GET
path: "/campaigns/{campaign_id}/results"
tags: ["Campaigns"]
---

# Get Campaign results

`GET /campaigns/{campaign_id}/results`

Get results for a Campaign

## Path parameters

- `campaign_id` integer, required

## Query parameters

- `start_time` string, date-time
- `end_time` string, date-time
- `browser` 'firefox' | 'chrome' | 'internet_explorer' | 'opera' | 'safari'
- `device` 'desktop' | 'ipad' | 'iphone' | 'mobile' | 'tablet'
- `source` 'campaign' | 'direct' | 'referral' | 'search'
- `attribute_id` integer
- `attribute_value` string
- `segment_conditions` string

## Response `200`

Return Campaign results

- CampaignResults
  - `campaign_id` integer — The unique identifier for the Campaign
  - `confidence_threshold` number, double — The significance level at which you would like to declare winning and losing variations. A lower number minimizes the time needed to declare a winning or losing variation, but increases the risk that your results aren't true winners and losers.
  - `end_time` string, date-time — End of the time interval (exclusive) used to calculate the results. The time is formatted in ISO 8601.
  - `is_stale` boolean — When true, indicates the results were delivered from a cache that is out of date.
  - `metrics` CampaignMetricResults[] — The breakdown of Campaign results by metric. CampaignMetricResults object ordering in the array is consistent with the order that metrics are attached to the Experiment in the Optimizely UI and REST API (i.e. index 0 is the primary metric, indices 1-4 are secondary metrics, indices 5+ are monitoring metrics). See here for an explantion of the impact of metric ordering on results calculations.
    - `aggregator` 'unique' | 'count' | 'sum' | 'bounce' | 'exit' | 'ratio' — The aggregation function for the numerator of the metric. 'unique' measures the number of unique visitors/sessions that include the specified Event. 'count' measures the total number of occurrences of Event for the scope (visitor/session). 'sum' is the sum of the 'field' value
    - `event_id` integer, nullable — The ID for the Event to select data from. Omitted for global metrics that are not relative to a specific Event, i.e. "overall revenue"
    - `event_properties` MetricEventProperties — The conditions used to filter the metric on specific event property values.
      - `filter` MetricFilter — The set of event property conditions a conversion must match to be counted toward the metric.
        - `combine_operator` 'and' | 'or' — Determines whether all conditions (and) or any condition (or) must be met.
        - `conditions` MetricFilterCondition[]
          - `name` string — The name of the event property to match to.
          - `operator` 'equal_to' | 'not_equal_to' | 'greater_than' | 'greater_than_or_equal_to' | 'less_than' | 'less_than_or_equal_to' | 'contains' | 'does_not_contain' — The type of match to be performed. equal_to and not_equal_to are available for all property types. greater_than, greater_than_or_equal_to, less_than, and less_than_or_equal_to are only available for properties with type number. contains and does_not_contain are only available for properties with type string.
          - `type` 'boolean' | 'number' | 'string' — The data type of the event property.
          - `value` string — The value the conversion's property should match, according to the operator.
    - `field` 'revenue' | 'value' — The field to aggregate for the numerator of the metric. Required when 'aggregator' = 'sum', otherwise omitted
    - `metrics` CompoundSubMetric[] — A list of all metrics that will be used in the calculation of a ratio metric.
      - `aggregator` 'unique' | 'count' | 'sum' — The aggregation function for the numerator of the metric. 'unique' measures the number of unique visitors/sessions that include the specified Event. 'count' measures the total number of occurrences of Event for the scope (visitor/session). 'sum' is the sum of the 'field' value.
      - `event_id` integer, nullable — The ID for the Event to select data from.
      - `event_type` 'custom' | 'click' | 'pageview' — The type of this Event.
      - `field` 'revenue' | 'value', nullable — The field to aggregate for the numerator of the metric. Required when 'aggregator' = 'sum', otherwise omitted.
      - `scope` 'session' | 'visitor' | 'event' — Specifies how Events should be grouped. Can also be thought of as the denominator of the metric. 'session' divides by the number of sessions. "Influenced sessions", or sessions that do not contain a decision Event but carry a decision from a previous session are not included in counts for numerator or denominator. 'visitor' divides by the number of visitors. 'event' divides by the total occurrences (impressions) of the specified Event.
    - `name` string — The name of the Metric
    - `results` object — A map of results for the variants affected by the Campaign. Variants may represent aggregated results scoped to the Campaign and/or individual Experiment results scoped to just that Experiment. The special variant 'baseline' represents visitors that have been held back from any change in experience across all Experiments in the Campaign. The special variant 'campaign' represents the aggregated effect of all Experiments included in the Campaign.
    - `scope` 'session' | 'visitor' | 'event' — Specifies how Events should be grouped together. Can also be thought of as the denonimator of the metric. 'session' divides by the number of sessions. "Influenced sessions", or sessions that do not contain a decision Event but carry a decision from a previous session are not included in counts for numerator or denominator. 'visitor' divides by the number of visitors. 'event' divides by the total occurrences (impressions) of the specified Event
    - `time_window` string — The maximum amount of time a numerator event can differ from a denominator event in order to be included in a ratio metric. This can be an integer, or an integer followed by a letter denoting the unit of time (d = days, h = hours, m = minutes). If no unit of time is supplied, hours is assumed. If no value is supplied, a time window of 48 hours is assumed.
    - `winning_direction` 'increasing' | 'decreasing' — The winning direction of this metric
  - `start_time` string, date-time — Start of the time interval (inclusive) used to calculate the results. The time is formatted in ISO 8601.

## Other responses

- `202` — The results request has been received but has not yet finished processing. Wait a bit and try again.
- `204` — There are no results data for this Campaign yet. Make sure the Campaign is started and try again later
- `default` — Unexpected error

---

[API](https://skmtc.dev/optimizely/apis/optimizely-api.md) · [All operations](https://skmtc.dev/optimizely/apis/optimizely-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/optimizely/optimizely-api/revisions/5151fe6a2297/schema)
