Boss Nass
Boss Nass

Reputation: 3522

Koala Gem get page insights

I am using the Koala gem, and currently trying to get some of the Page insights like impressions etc.. I am presently using the below, which only seems to be returning []

def page_impressions page_id
    @user_graph = Koala::Facebook::API.new(current_user.oauth_token)
    page_token = @user_graph.get_page_access_token(page_id)
    @page_graph = Koala::Facebook::API.new(page_token)
    @page_graph .get_connections(page_id, 'insights', metric: 'page_impressions_frequency_distribution', period: 'week')
  end

Upvotes: 1

Views: 942

Answers (1)

Mike Szyndel
Mike Szyndel

Reputation: 10592

Shouldn't you request it like that?

@page_graph.get_connections(page_id, 'insights/page_impressions_frequency_distribution', period: 'week')

Upvotes: 2

Related Questions