Module: FbGraph::Connections::AdGroupStats

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

Instance Method Summary collapse

Instance Method Details

#ad_group_stats(options = {}) ⇒ Object

When retrieving stats at the AdAccount level we use the ‘adgroupstats’ connection This returns an Array of statistics



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

def ad_group_stats(options = {})
  ad_group_stats = self.connection :adgroupstats, options
  ad_group_stats.map! do |ad_group_stat|
    AdGroupStat.new ad_group_stat[:id], ad_group_stat.merge(
      :access_token => options[:access_token] || self.access_token
    )
  end
end