You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Facebook Marketing API:洞察数据时区及当日数据查询起始时间问询

Hey there, let's tackle your questions about Facebook Marketing API's insight data time zones step by step:

Q1: Which time zone does Facebook Marketing API's insight data use?

The insight data returned by the Facebook Marketing API always uses the time zone linked to your Ad Account. This is a static setting tied to your account configuration—you can't change this time zone for insight queries via API parameters. All metrics, date ranges, and timestamps in the response are aligned to this account-level time zone.

Q2: If querying AdSet insights that include the current day, what's the start time of the day's metrics, and which time zone applies?

  • The current day's insight metrics (like CTR, ROAS) start accumulating from 00:00 in your Ad Account's time zone.
  • When you include the current day in your time_range, the returned data for that day will be the cumulative metrics from 00:00 (account time zone) up to the exact moment you send the API request.
  • The time zone used here remains your Ad Account's time zone—there's no automatic shift to UTC or your local system time.

A quick note on your sample code

I spotted a small typo ($parmas should be $params) in your snippet; here's the corrected version, plus some context:

$adset = new FacebookAds\Object\AdSet($adset_id);
$params = [];
$params['time_increment'] = 1; // This breaks down data into daily chunks
$params['time_range'] = [ 
    'since' => date('Y-m-d', strtotime('-30 days')), 
    'until' => date('Y-m-d') 
];
// Fixed the typo here from $parmas to $params
$insightCursor = $adset->getInsights([ 'ctr', 'website_purchase_roas' ], $params); 

foreach ($insightCursor as $insight) {
    $date = $insight->{AdsInsightsFields::DATE_START};
    $ctr = $insight->{AdsInsightsFields::CTR};
    $roas = $insight->{AdsInsightsFields::WEBSITE_PURCHASE_ROAS};
}

The DATE_START value you're retrieving will be the start of the day in your Ad Account's time zone. For the current day (the until date in your params), this timestamp will match the current date in the account's time zone, and the metrics will reflect all activity from 00:00 that day up to when you made the request.

内容的提问来源于stack exchange,提问作者Ben

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 03:53:37