如何在设定的时间段内过滤Facebook线索

编程入门 行业动态 更新时间:2024-10-17 04:55:26
本文介绍了如何在设定的时间段内过滤Facebook线索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用Facebook API v4获取潜在客户列表(使用PHP和库中内置的get方法.我想知道如何将日期范围传递到请求中,以便仅获取2个日期之间的潜在客户

I'm using the Facebook API v4 to get a list of the leads(using PHP and the get method built into the library. I want to know how to pass a date range into the request to only get leads between 2 dates.

我首先使用以下方法获取广告列表:

I'm first getting a list of adets using the following:

$request = $fb->get( $account_id . '/ads?fields=name&limit=100&transport=cors', $access_token );

然后,我遍历这些广告ID以获得一系列潜在客户:

Then I'm looping over those ads id's to get an array of leads:

foreach ($adSets as $ad){ $request = $fb->get( $ad['id'] . '/leads?fields=ad_name,adset_name,campaign_name,created_time,field_data&limit=100', $access_token ); $request->getGraphEdge()->asArray(); }

这一切都很好,但是我想获得2个日期之间的潜在客户列表.过滤部分 developers下的文档. facebook/docs/marketing-api/guides/lead-ads/retrieving/提示我可以通过以及from_date和to_date,但我似乎无法满足上述要求.

This all works perfectly fine but I want to get a list of leads between 2 dates. The documentation here under the filtering section developers.facebook/docs/marketing-api/guides/lead-ads/retrieving/ hints I can pass and from_date and to_date but I can't seem to get that working with my above request.

关于如何传递日期范围的任何想法?

Any ideas on how I can pass a date range?

推荐答案

您应过滤字段time_created

从在此处提交文档:

此示例根据时间戳过滤销售线索.时间戳记应为 Unix时间戳.

This example filters leads based on timestamps. Timestamps should be Unix timestamp. curl -G \ --data-urlencode 'filtering=[ { "field": "time_created", "operator": "GREATER_THAN", "value": 1516682744 } ]' \ -d 'access_token=<ACCESS_TOKEN>' \ graph.facebook/v4.0/<AD_ID>/leads

请记住:

自Unix纪元以来的秒数

number of seconds since the Unix Epoch

希望获得帮助

更多推荐

如何在设定的时间段内过滤Facebook线索

本文发布于:2023-06-11 03:52:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/626186.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:线索   时间段内   如何在   Facebook

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!