Sha256: 6f4b8c273aee6acbfae95059a5d01577225d1e49ce7d469ac6c60e11d6d5ae72

Contents?: true

Size: 897 Bytes

Versions: 19

Compression:

Stored size: 897 Bytes

Contents

module FbGraph
  module Connections
    module AdGroupStats
      # When retrieving stats at the AdAccount level we use the 'adgroupstats' connection
      # This returns an Array of statistics
      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

      # Note: This could also be a connection on the AdGroup model, but it has a different connection name
      # 'stats' instead of 'adgroupstats'
      # In addition, it returns a single JSON response that does not conform to the standard connections 
      # array structure, making it difficult to parse with the underlying fb_graph Connection object.
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
fb_graph-2.2.6 lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.2.5 lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.2.4 lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.2.3 lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.2.2 lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.2.1 lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.2.0 lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.2.0.beta lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.2.0.alpha2 lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.2.0.alpha lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.1.13 lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.1.12 lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.1.11 lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.1.10 lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.1.9 lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.1.8 lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.1.7 lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.1.6 lib/fb_graph/connections/ad_group_stats.rb
fb_graph-2.1.5 lib/fb_graph/connections/ad_group_stats.rb