ADFORM API PHP指标 - NEWB警告

问题描述 投票:0回答:1

对于PHP和API来说,我是一个新手,所以如果我在术语上犯了任何错误,请原谅我。

我正在创建一个API来从ADFORM reports调用数据,并且在选择各种指标时遇到问题。

我向https://api.adform.com/v1/reportingstats/agency/reportdata发帖

{
  "dimensions": [
    "client",
    "campaign"
  ],
  "metrics": [
                "clicks",
                "impressions"

  ],
  "filter": {
    "date": "campaignStartToEnd"
  }
}

响应:

Array
(
    [reportData] => Array
        (
            [columnHeaders] => Array
                (
                    [0] => client
                    [1] => campaign
                    [2] => clicks
                    [3] => impressions
                )

            [columns] => Array
                (
                    [0] => Array
                        (
                            [key] => client
                        )

                    [1] => Array
                        (
                            [key] => campaign
                        )

                    [2] => Array
                        (
                            [key] => clicks
                            [specs] => Array
                                (
                                    [dataSource] => adform
                                    [adUniqueness] => all
                                )

                        )


                    [3] => Array
                        (
                            [key] => impressions
                            [specs] => Array
                                (
                                    [dataSource] => adform
                                    [adUniqueness] => all
                                )

                        )

                )

在响应中,adUniqueness =“all”是默认值,但是从Adform文档(http://api.adform.com/help/references/buyer-solutionsc/reporting/metadata/metrics)中还有其他唯一性级别的统计信息。

{
  "metricsMetadata": [
    {
      "key": "clicks",
      "category": "Delivery",
      "displayName": "Clicks",
      "displayFormat": "n0",
      "description": "This metric shows the number of clicks for the selected dimension. A click occurs when a user interacts with the advertisement by engaging a mouse button (usually the left) while the mouse pointer is hovering over the advertisement.",
      "specsMetadata": [
        {
          "key": "adUniqueness",
          "displayName": "Uniqueness",
          "description": "Display statistics for selected uniqueness level",
          "specValuesMetadata": [
            {
              "key": "all",
              "displayName": "All",
              "isDefault": true,
              "description": ""
            },
            {
              "key": "campaignUnique",
              "displayName": "Campaign unique",
              "isDefault": false,
              "description": ""
            }
          ]
        }
      ]
    }

如何将"campaignUnique"添加到POST?

php json api
1个回答
0
投票
{
  "dimensions": [
    "client",
    "campaign"
  ],
  "metrics": [
    {
      "metric": "impressions",
      "specs": {
        "adUniqueness": "campaignUnique"
      }
    },
{
      "metric": "impressions",
      "specs": {
        "adUniqueness": "all"
      }
    },
    {
      "metric": "clicks",
      "specs": {
        "adUniqueness": "campaignUnique"
      }
      },
 {
      "metric": "clicks",
      "specs": {
        "adUniqueness": "all"
      }
    }
  ],
  "filter": {
    "date": {"from":"2018-01-01", "to":"2018-02-20"}
  }
}
© www.soinside.com 2019 - 2024. All rights reserved.