Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. $campaignSets = json_decode($account->getCampaigns($fields)->getResponse()->getBody());
  2. print_r($campaignSets->data);
  3. echo "<br><br>";
  4. $insight_fields = array(
  5. 'campaign_name',
  6. 'adset_name',
  7. 'adset_id',
  8. 'ad_name',
  9. 'ad_id',
  10. 'clicks',
  11. 'impressions',
  12. 'reach',
  13. 'spend',
  14. 'cpc',
  15. 'cpm',
  16. 'cpp',
  17. 'ctr',
  18. 'reach',
  19. 'unique_clicks',
  20. 'unique_ctr',
  21. 'cost_per_unique_click',
  22. 'actions',
  23. 'cost_per_action_type'
  24. );
  25.  
  26. $insight_params = array(
  27. 'level' => 'account',
  28. 'time_range' => array(
  29. 'since' => "2017-06-01",
  30. 'until' => "2017-07-31"
  31. ),
  32. 'date_preset' => 'lifetime'
  33. );
  34.  
  35. $insights = $account->getInsights($insight_fields, $insight_params)->getResponse()->getBody();
  36. print_r($insights);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement