GraphQL Reporting API Examples

The examples on this page contain GraphQL queries. For how to run these queries, see Your First Query.

List of Advertisables for your Organization

{
  organization {
    current {
      advertisables {
        eid
        name
      }
    }
  }
}

List of Campaigns for an Advertisable

{
  advertisable {
    byEID(advertisable: "MY_ADVERTISABLE_EID") {
      eid
      name
      campaigns {
        eid
        name
      }
    }
  }
}

Delivery and Attribution data for all Campaigns

{
  advertisable {
    byEID(advertisable: "MY_ADVERTISABLE_EID") {
      eid
      name
      campaigns {
        eid
        name
        channel
        metrics(start: "2017-06-01", end: "2017-06-02", currency: "USD") {
          byDate {
            # Deliveries
            impressions
            clicks
            cost

            # Attribution
            viewThroughs
            clickThroughs
            viewRevenue
            clickRevenue
          }
        }
      }
    }
  }
}

Delivery and Attribution data for a Campaign

{
  campaign {
    byEID(campaign: "MY_CAMPAIGN_EID") {
      eid
      name
      metrics(start: "2017-06-01", end: "2017-06-02", currency: "USD") {
        byDate {
          impressions
          clicks
          cost
          viewThroughs
          clickThroughs
          viewRevenue
          clickRevenue
        }
      }
    }
  }
}

Delivery and Attribution data for an AdGroup

{
  adgroup {
    byEID(adgroup: "MY_ADGROUP_EID") {
      eid
      name
      status
      metrics(start: "2017-06-01", end: "2017-06-02", currency: "USD") {
        byDate {
          # Deliveries
          impressions
          clicks
          cost

          # Attribution
          viewThroughs
          clickThroughs
          viewRevenue
          clickRevenue
        }
      }
    }
  }
}

Delivery and Attribution data for an Ad

{
  ad {
    byEID(ad: "MY_AD_EID") {
      eid
      name
      adFormatName
      metrics(start: "2017-06-01", end: "2017-06-02", currency: "USD") {
        byDate {
          impressions
          clicks
          cost
          viewThroughs
          clickThroughs
          viewRevenue
          clickRevenue
        }
      }
    }
  }
}

Connected TV Campaign Metrics

To retrieve metrics for Connected TV (CTV) campaigns, you must include the enableConnectedTVCampaigns:true flag in your query. This enables access to video-specific metrics.

query ($advertisable_eid: String!, $start_date: Date!, $end_date: Date!) {
  flags(enableConnectedTVCampaigns:true)
  advertisable {
    byEID(advertisable: $advertisable_eid) {
      eid
      name
      campaigns {
        eid
        name
        channel
        metrics(start: $start_date, end: $end_date, currency: "USD") {
          summary {
            impressions
            clicks
            cost
            viewThroughs
            clickThroughs
            viewRevenue
            clickRevenue
            videoImpressions
            videoViews
            videoTwentyFivePercent
            videoFiftyPercent
            videoSeventyFivePercent
            videoHundredPercent
          }
        }
        adgroups {
          eid
          name
          metrics(start: $start_date, end: $end_date, currency: "USD") {
            summary {
              impressions
              clicks
              cost
              viewThroughs
              clickThroughs
              viewRevenue
              clickRevenue
              videoImpressions
              videoViews
              videoTwentyFivePercent
              videoFiftyPercent
              videoSeventyFivePercent
              videoHundredPercent
            }
          }
        }
      }
    }
  }
}

Query Variables:

{
  "advertisable_eid": "MY_ADVERTISABLE_EID",
  "start_date": "2025-08-01",
  "end_date": "2025-08-28"
}

Granular Conversions for an Advertisable

You can use this query to replicate the Granular Conversion Report (GCR) that is generated in the dashboard. Note that this API does not support the converted user’s email. If you need an email address, you’ll have to use the GCR genreated by the dashboard.

{
  advertisable {
    byEID(advertisable: "MY_ADVERTISABLE_EID") {
      granularConversions(start: "2020-06-01", end: "2020-07-01") {
        time
        type
        attributionModel
        attributionCredit
        adrollConversionId
        touchpointTimestamp
        attributedConversions
        lastTouchAttribution
        channel
        campaignEID
        campaignType
        campaignName
        adgroupEID
        adgroupName
        adEID
        adName
        adSize
        segmentEID
        segmentName
        attributedRevenue
        externalData
        device
        country
        city
        firstTouchTimestamp
        lastTouchTimestamp
        daysToConversionFirstTouch
        daysToConversionLastTouch
        referrerURL
      }
    }
  }
}