Module: FbGraph::Connections::AdCampaignStats

Included in:
AdAccount
Defined in:
lib/fb_graph/connections/ad_campaign_stats.rb

Instance Method Summary collapse

Instance Method Details

#ad_campaign_stats(options = {}) ⇒ Object

When retrieving stats at the AdAccount level we use the 'adcampaignstats' connection This returns an Array of statistics


6
7
8
9
10
11
12
13
# File 'lib/fb_graph/connections/ad_campaign_stats.rb', line 6

def ad_campaign_stats(options = {})
  ad_campaign_stats = self.connection :adcampaignstats, options
  ad_campaign_stats.map! do |ad_campaign_stat|
    AdCampaignStat.new ad_campaign_stat[:id], ad_campaign_stat.merge(
      :access_token => options[:access_token] || self.access_token
    )
  end
end