Google广告获得了基于日期和美国所有州的广告系列广告支出

发布于 2025-02-01 13:05:20 字数 862 浏览 1 评论 0 原文

我有很多竞选活动,我想总结所有州(美国)的支出,并基于日期和日期。

我浏览了 https://developers.google.com/google-com/google-com/google-com/google-com/google-google-google-com- ADS/API/DOC/REPORTING/概述,但我看不出可以根据状态确定支出的任何观点。

我需要在Google ADS API中使用哪个端点:在FB中,我正在使用 access_token&access_token& fields> fields& fields = spect& amp; amp; amp; amp; amp; amp; emp; emp; emp; emp; emp; emp; emp; emp; emp; emp; emp; %27%3A%272022-05-15%27%2C%27until%27%3A%272022-05-15%27%7D&limp; limit = 100& after = otkzd = otkzd

任何帮助都非常感谢。

I have many campaigns and I want to summarize the spends by all the states (USA states) and based on from and to dates.

I went through the https://developers.google.com/google-ads/api/docs/reporting/overview but I dont see any point that can determine the spends based on states.

Which endpoint I need to use in Google Ads API: In the FB I am using https://graph.facebook.com/v13.0/act_2264578877108750/insights?access_token=<ACCESS_TOKEN>&fields=spend&breakdowns=region%2Ccountry&level=ad&time_range=%7B%27since%27%3A%272022-05-15%27%2C%27until%27%3A%272022-05-15%27%7D&limit=100&after=OTkZD

Any help is really appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故事↓在人 2025-02-08 13:05:20

通过在

SELECT
  campaign.name,
  segments.geo_target_state,
  metrics.cost_micros
FROM geographic_view
WHERE
  geographic_view.location_type = LOCATION_OF_PRESENCE
  AND segments.date BETWEEN 20220101 AND 20220430

这将返回广告系列名称和状态与各自支出的每一个组合,而在其中的条款确保当点击发生时使用实际上是在该状态下的 -与某人感兴趣的人相反。

请注意, segments.geo_target_state 将以ID返回,您可以找到参考数据在这里。此外, greatics.cost_micros 将以帐户的基本货币的百万分返回,即您需要将值乘以1'000'000。


关于使用哪个端点:rest 不推荐Google < /a>(您应该宁愿通过客户端库使用GRPC),但是这里应该有效:

curl "https://googleads.googleapis.com/v10/customers/${CUSTOMER_ID}/googleAds:searchStream" \
  --header "Content-Type: application/json" \
  --header "developer-token: ${DEVELOPER_TOKEN}" \
  --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \
  --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
  --data '{
    "query": "
      SELECT
        campaign.name,
        segments.geo_target_state,
        metrics.cost_micros
      FROM geographic_view
      WHERE
        geographic_view.location_type = LOCATION_OF_PRESENCE
        AND segments.date BETWEEN 20220101 AND 20220430
    "
  }'

Reporting in the Ads API works by defining a query in GAQL that describes the data you want to obtain. For your use case, a possible query would look something like this:

SELECT
  campaign.name,
  segments.geo_target_state,
  metrics.cost_micros
FROM geographic_view
WHERE
  geographic_view.location_type = LOCATION_OF_PRESENCE
  AND segments.date BETWEEN 20220101 AND 20220430

This will return rows for every combination of campaign name and state with the respective spend, while the WHERE clause makes sure that the use actually was in that state when the click happened—as opposed to somebody being interested in it.

Note that segments.geo_target_state will be returned as an ID, you can find the reference data here. Additionally, metrics.cost_micros will be returned in millionth of the base currency of the accounts, i.e. you'll need to multiply the value by 1'000'000.


About which endpoint to use: REST isn't recommended by Google (you should rather be using gRPC via a client library), but this here should work:

curl "https://googleads.googleapis.com/v10/customers/${CUSTOMER_ID}/googleAds:searchStream" \
  --header "Content-Type: application/json" \
  --header "developer-token: ${DEVELOPER_TOKEN}" \
  --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \
  --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
  --data '{
    "query": "
      SELECT
        campaign.name,
        segments.geo_target_state,
        metrics.cost_micros
      FROM geographic_view
      WHERE
        geographic_view.location_type = LOCATION_OF_PRESENCE
        AND segments.date BETWEEN 20220101 AND 20220430
    "
  }'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文