Migrate from the Reporting API

The GraphQL Reporting API is the best way to easily fetch all the metrics for your accounts. If you’re still using the Reporting API, you can use this guide to upgrade your integration.

Benefits:

  • Fetch delivery and attribution data in a single call

  • Get details about the objects you’re reporting on such, as the name or campaign types

  • Retrieve metrics for nested objects

If you’re unfamiliar with the GraphQL Reporting API, you should check out the introduction first.

Helpful tips

The sample queries make use of two GraphQL features that may be new to you:

When querying objects, you can query the object by EID or through its parent object (i.e., fetch all Campaigns in an Advertisable)

The following are the vital GraphQL types in our schema that contain reporting data. They can be accessed through a variety of queries.

GraphQL makes it easy to query for a lot of data in a single request. However, be mindful of how many subject objects you’re querying and how many days of data you’re fetching. We recommend you paginate your requests using GraphQL variables for the list of EIDs and date ranges you’re retrieving.

You can experiment with building queries using GraphiQL.

Replacement GraphQL queries

To help you migrate your application, the following tables give you a sample replacement query for each Reporting API endpoint. You can find additional examples in GraphQL Reporting API Examples.

Reporting API endpoints with a direct replacement

Category

Endpoint

Example GraphQL queries

Attribution

/uhura/v1/attributions/ad

Metrics by Ad

Attribution

/uhura/v1/attributions/adgroup

Metrics by AdGroup

Attribution

/uhura/v1/attributions/advertisable

Metrics by Advertisable

Attribution

/uhura/v1/attributions/campaign

Metrics by Campaign

Attribution

/uhura/v1/attributions/export

Attribution

/uhura/v1/attributions/wca-placement/export

Metrics by Facebook Placement

Attribution

/uhura/v1/attributions/wca-placement

Metrics by Facebook Placement

Attribution

/uhura/v1/combined-granular-attributions

Granular Conversions

Deliveries

/uhura/v1/deliveries/ad

Metrics by Ad

Deliveries

/uhura/v1/deliveries/adgroup

Metrics by AdGroup

Deliveries

/uhura/v1/deliveries/advertisable

Metrics by Advertisable

Deliveries

/uhura/v1/deliveries/campaign

Metrics by Campaign

Deliveries

/uhura/v1/deliveries/export

Deliveries

/uhura/v1/deliveries/wca-placement

Metrics by Facebook Placement

The following Reporting API endpoints don’t have a direct replacement, but in the notes column you’ll find suggested workarounds.

Reporting API endpoints without a replacement

Category

Endpoint

Notes

Attribution

/uhura/v1/attributions/segment

Instead of retrieving by segment, fetch attribution metrics by AdGroup, Campaign, or Advertisable

Attribution, Deliveries

/uhura/v1/email-domain-metrics/export

No replacement available, this metric only applies to campaigns targeting CRM audiences on the Web

Attribute

/uhura/v1/retargeting-attributes/advertisable

See the create attribute audiences guide

Attribute

/uhura/v1/segment-attributes/advertisable

See the create attribute audiences guide

Deliveries

/uhura/v1/segment-deliveries/advertisable

Fetch delivery metrics by Advertisable

Deliveries

/uhura/v1/segment-deliveries/export

Fetch delivery metrics by AdGroup, Campaign, or Advertisable

Deliveries

/uhura/v1/segment-deliveries/segment

Fetch delivery metrics by AdGroup, Campaign, or Advertisable

Deliveries

/uhura/v1/segmentation-event-deliveries/segment

Fetch delivery metrics by AdGroup, Campaign, or Advertisable

Deliveries

/uhura/v1/deliveries/domain/ad

RollWorks customers can fetch delivery metrics by Account for campaign

Deliveries

/uhura/v1/deliveries/domain/adgroup

RollWorks customers can fetch delivery metrics by Account for campaign

Deliveries

/uhura/v1/deliveries/domain

RollWorks customers can fetch delivery metrics by Account for campaign

Index of sample queries by object types

Metrics by Advertisable

Replaces

  • /uhura/v1/attributions/advertisable

  • /uhura/v1/attributions/export

  • /uhura/v1/deliveries/advertisable

  • /uhura/v1/deliveries/export

query AdvertisableMetricsQuery($advertisables: [String], $startDate: Date, $endDate: Date) {
  advertisable {
    byEIDs(eids: $advertisables) {
      eid
      name
      metrics(start: $startDate, end: $endDate) {
        summary {
          ...performanceMetrics
          ...conversionMetrics
        }
        byDate {
          date
          ...performanceMetrics
          ...conversionMetrics
        }
      }
    }
  }
}

fragment performanceMetrics on MetricForAdvertisable {
  cost
  impressions
  clicks
  ctr
  cpm
  cpc
}

fragment conversionMetrics on MetricForAdvertisable {
  conversions
  cpa
  clickThroughs
  clickCPA
  viewThroughs
  viewCPA
}

Metrics by Campaign

Replaces

  • /uhura/v1/attributions/campaign

  • /uhura/v1/attributions/export

  • /uhura/v1/deliveries/campaign

  • /uhura/v1/deliveries/export

query CampaignMetricsQuery($campaigns: [String], $startDate: Date, $endDate: Date) {
  campaign {
    byEIDs(eids: $campaigns) {
      eid
      name
      metrics(start: $startDate, end: $endDate) {
        summary {
          ...performanceMetricsSummary
          ...conversionMetricsSummary
        }
        byDate {
          date
          ...performanceMetrics
          ...conversionMetrics
        }
      }
    }
  }
}

fragment performanceMetricsSummary on Metric {
  cost
  impressions
  clicks
  ctr
  cpm
  cpc
}

fragment conversionMetricsSummary on Metric {
  conversions
  cpa
  clickThroughs
  clickCPA
  viewThroughs
  viewCPA
}

fragment performanceMetrics on MetricForCampaign {
  cost
  impressions
  clicks
  ctr
  cpm
  cpc
}

fragment conversionMetrics on MetricForCampaign {
  conversions
  cpa
  clickThroughs
  clickCPA
  viewThroughs
  viewCPA
}

Metrics by AdGroup

Replaces

  • /uhura/v1/attributions/adgroup

  • /uhura/v1/attributions/export

  • /uhura/v1/deliveries/adgroup

  • /uhura/v1/deliveries/export

query AdGroupMetricsQuery($adgroups: [String], $startDate: Date, $endDate: Date) {
  adgroup {
    byEIDs(eids: $adgroups) {
      eid
      name
      metrics(start: $startDate, end: $endDate) {
        summary {
          ...performanceMetrics
          ...conversionMetrics
        }
        byDate {
          date
          ...performanceMetrics
          ...conversionMetrics
        }
      }
    }
  }
}

fragment performanceMetrics on Metric {
  cost
  impressions
  clicks
  ctr
  cpm
  cpc
}

fragment conversionMetrics on Metric {
  conversions
  cpa
  clickThroughs
  clickCPA
  viewThroughs
  viewCPA
}

Metrics by Ad

Replaces

  • /uhura/v1/attributions/ad

  • /uhura/v1/attributions/export

  • /uhura/v1/deliveries/ad

  • /uhura/v1/deliveries/export

query AdMetricsQuery($ads: [String], $startDate: Date, $endDate: Date) {
  ad {
    byEIDs(eids: $ads) {
      eid
      name
      metrics(start: $startDate, end: $endDate) {
        summary {
          ...performanceMetrics
          ...conversionMetrics
        }
        byDate {
          date
          ...performanceMetrics
          ...conversionMetrics
        }
      }
    }
  }
}

fragment performanceMetrics on Metric {
  cost
  impressions
  clicks
  ctr
  cpm
  cpc
}

fragment conversionMetrics on Metric {
  conversions
  cpa
  clickThroughs
  clickCPA
  viewThroughs
  viewCPA
}

Metrics by Facebook Placement

Replaces

  • /uhura/v1/attributions/wca-placement

  • /uhura/v1/deliveries/wca-placement

  • /uhura/v1/attributions/wca-placement/export

query FacebookPlacementMetricsQuery($adgroups: [String], $startDate: Date, $endDate: Date) {
  adgroup {
    byEIDs(eids: $adgroups) {
      eid
      name
      placements(start: $startDate, end: $endDate) {
        byPlacement {
          placement
          ...performanceMetrics
          ...conversionMetrics
        }
      }
    }
  }
}

fragment performanceMetrics on Placement {
  cost
  impressions
  clicks
  ctr
  cpm
  cpc
}

fragment conversionMetrics on Placement {
  conversions
  cpa
  clickThroughs
  clickCPA
  viewThroughs
  viewCPA
}

Metrics by Delivery Account

Replaces

  • /uhura/v1/deliveries/domain

  • /uhura/v1/deliveries/domain/ad

  • /uhura/v1/deliveries/domain/adgroup

RollWorks customers can query for delivery metrics for Accounts targeted by their campaigns.

query AccountMetrics($advertisable: String, $campaigns: [String], $startDate: Date, $endDate: Date) {
  accountMetrics {
    summary(advertisableEID: $advertisable, campaignEIDs: $campaigns, start: $startDate, end: $endDate) {
      domain
      cost
      impressions
      clicks
      adjustedClickThroughs
      adjustedViewThroughs
    }
  }
}

Granular Conversions

Replaces

  • /uhura/v1/combined-granular-attributions

query GranularConversionsQuery($advertisables: [String], $startDate: Date, $endDate: Date) {
  advertisable {
    byEIDs(eids: $advertisables) {
      granularConversions(start: $startDate, end: $endDate) {
        time
        type
        attributionCredit
        adrollConversionId
        touchpointTimestamp
        attributedConversions
        lastTouchAttribution
        channel
        campaignEID
        campaignType
        campaignName
        adgroupEID
        adgroupName
        adEID
        adName
        adSize
        segmentEID
        segmentName
        attributedRevenue
        externalData
        device
        campaignEID
      }
    }
  }
}