How to get the insights per campaign for multiple campaigns that belong to a specific ad account in a single call

Digital Marketing Facebook Marketing API 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating
_x000D_ _x000D_ We want to get the insights per campaign for multiple campaigns that belong to a specific ad account in a single call. I am using the following http call and it returns me the correct insights(reach, impressions and clicks) and other data per campaign for the last 30 days only. https://graph.facebook.com/v3.3//campaigns?fields=name,status,insights{reach,impressions,clicks}&access_token= How can I use the parameter date_preset so that I will be able to get the insights(reach, impressions and clicks) and other data per campaign for lifetime? If there is any other way to get the above insights for lifetime without using the date_preset please do not hesitate to advise me how to get them. We wanted to let you know that our app is written in php.

Posted on 16 Aug 2022, this text provides information on Facebook Marketing API related to Digital Marketing. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago
_x000D_ Because insights is an edge of the campaign object you can apply some filter parameters via dot on that edge, like this: https://graph.facebook.com/v3.3//campaigns?fields=name,status,insights.date_preset(lifetime){reach,impressions,clicks}&access_token= Or, if you want to check Insights with the time breakdown (three months, for example) and also take a look on the lifetime summary you can do it like this: https://graph.facebook.com/v3.3//campaigns?fields=name,status,insights.default_summary(true).limit(3).date_preset(lifetime).time_increment(monthly){reach,impressions,clicks}&access_token= { "name": "Campaign Name", "status": "Campaign Status", "insights": { "data": [ { "reach": "149599", "impressions": "291917", "clicks": "13517", "date_start": "2019-01-11", "date_stop": "2019-01-31" }, { "reach": "265556", "impressions": "456458", "clicks": "7915", "date_start": "2019-02-01", "date_stop": "2019-02-28" }, { "reach": "233641", "impressions": "331600", "clicks": "4671", "date_start": "2019-03-01", "date_stop": "2019-03-31" } ], "paging": { "cursors": { "before": "BFR", "after": "AFT" }, "next": "next link" }, "summary": { "reach": "660772", "impressions": "1486924", "clicks": "32484", "date_start": "2019-01-11", "date_stop": "2019-05-06" } }, "id": "000" } https://developers.facebook.com/docs/marketing-api/insights/parameters#param

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.