This topic describes how to configure a request to the getTrafficReport method.

You can generate two types of traffic reports:

  • A report that covers a date range.
  • A report that covers a set of listings.

Generating a report that covers a date range

To generate a traffic report that covers a specific period of time:

  • Set the dimension query parameter to DAY.
  • Using the filters query parameter:
    • Specify the marketplace you want to target with the marketplace_ids parameter.
    • Set the start and end dates for the report using the date_range parameter.
  • Specify the metrics you want returned using the metric query parameter.

The following example shows a request that returns a Traffic Report based on days:

GET https://api.ebay.com/sell/analytics/v1/traffic_report?
    dimension=DAY&
    filter=marketplace_ids:{EBAY_US},date_range:[20160814..20160824]&
    metric=LISTING_IMPRESSION_SEARCH_RESULTS_PAGE,LISTING_IMPRESSION_STORE

Note: When you make a call to getTrafficReport, all the parameter values in the request must be URL encoded, as described in URL parameters.

Generating a report that covers a set of listings

To generate a traffic report that returns data on specific listings, and sorts the response on a specific metric:

  • Set dimension query parameter to LISTING.
  • Using the filters query parameter:
    • Set the start and end dates for the report using the date_range parameter.
    • Specify the listings on which you want data returned using the listing_ids parameter.
  • Use the metric query parameter to specify the metrics you want returned in the report.
  • Use the sort query parameter to specify the metric upon which you want the report sorted.

The following example shows a request that returns a Traffic Report based on listings. Note that this snippet shows URL-encoded parameter values:

GET https://api.ebay.com/sell/analytics/v1/traffic_report?
    dimension=LISTING&
    filter=listing_ids:%7B132213131|124232324|123141151%7D,date_range:%5B20160814..20160824%5D&
    metric=LISTING_IMPRESSION_SEARCH_RESULTS_PAGE,LISTING_IMPRESSION_STORE,LISTING_IMPRESSION_TOTAL&
    sort=LISTING_IMPRESSION_TOTAL

Note: You must URL-encode the special characters that you use to specify lists ({ }) and ranges ([ ]) within the query parameters that you pass in the request. In the example above, this pertains to the listing_ids and date_range query parameters, respectively.

An example response

The response below shows a report that's based on a time range.

The body of the report contains metrics.key fields that show the metric being returned, with each records container holding the dimension and metric values for each of the metrics in the report.

The specified dimension value is returned in the dimensionKeys.key field of the response.

The following response has been edited to save space.

{
  "reportType": "TRAFFIC",
  "header": {
    "dimensionKeys": [  {
      "key": "DAY",
      "localizedName": "day",
      "dataType": "DATE" } ],
    "metrics": [ {
      "key": "LISTING_IMPRESSION_SEARCH_RESULTS_PAGE",
      "localizedName": "Listing impressions from the search results page",
      "dataType": "NUMBER"
    },
    {
      "key": "SALES_CONVERSION_RATE",
      "localizedName": "Sales conversion rate",
      "dataType": "NUMBER"
    }  ]  },
    "records": [
     {
       "dimensionValues": [
       {
         "value": "Wed Jun 01 00:00:00 GMT-07:00 2016",
         "applicable": true
	}  ],
       "metricValues": [
         {
	    "value": 655,
	    "applicable": true
	  },
	  {
	    "value": 125,
	    "applicable": true
	}  ],
  "startDate": "2016-06-01T07:00.00.000Z",
  "endDate": "2016-08-29T06:59.059Z",
  "lastUpdatedDate": "2016-09-02T06:59.059Z"
}