【问题标题】:Google ads - get campaign name with photoGoogle 广告 - 获取带有照片的广告系列名称
【发布时间】:2020-11-12 19:33:08
【问题描述】:

我需要获取:

  1. 活动名称。
  2. 展示次数。
  3. 成本。
  4. 会话率。
  5. 转化次数。
  6. 日期。
  7. 预算。
  8. 此广告的图片/视频。

我可以从活动实体中获取所有内容吗?怎么样?

$googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();

// Creates a query that retrieves all campaigns.
$query = 'SELECT [MYLIST]  FROM campaign ORDER BY campaign.name';

// Issues a search stream request.
/** @var GoogleAdsServerStreamDecorator $stream */
$stream = $googleAdsServiceClient->searchStream($customerId, $query);

// Iterates over all rows in all messages and prints the requested field values for
// the campaign in each row.
foreach ($stream->iterateAllElements() as $googleAdsRow) {
    /** @var GoogleAdsRow $googleAdsRow */
    printf(
        "Campaign with ID %d and name '%s' was found.%s",
        $googleAdsRow->getCampaign()->getId(),
        $googleAdsRow->getCampaign()->getName(),
        AND SOMETHING HERE
        PHP_EOL
    );
}

【问题讨论】:

    标签: php google-ads-api


    【解决方案1】:

    无法取回广告图片。但是您可以调用广告报告并取回广告元素并以您喜欢的任何方式呈现。

    我,我会提取广告内容并使用carbon 之类的东西来生成图像。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-04-27
      • 2023-02-02
      • 1970-01-01
      • 2022-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多