garb
garb copied to clipboard
Getting "Requested 15 dimensions; only 7 are allowed." often
After a couple of reloads of the page displaying some results from my api interactions, I often get a Requested 15 dimensions; only 7 are allowed.
warning (it's not always 15, that differs). It seems that on every pageload the same instance of Garb::Model get's repopulated with metrics and dimensions which I set to classes in a module on the top of my file. Should I define the report class elsewhere?
The module looks like this:
module GoogleAnalytics
class Client < OAuth2::Client
def initialize
super ENV['ADMIN_DASHBOARD_GOOGLE_CLIENT_ID'], ENV['ADMIN_DASHBOARD_GOOGLE_CLIENT_SECRET']
end
end
class Token < OAuth2::AccessToken
def initialize(token)
super GoogleAnalytics::Client.new, token
end
end
class NumberOfEventsForLabel
extend Garb::Model
metrics :total_events
dimensions :event_category, :event_action, :event_label
end
class NumberOfVisitsPerPage
extend Garb::Model
metrics :page_views
dimensions :page_path
end
end
And I call the result via the shorthand: profile.number_of_visits_per_page.each do |res|
. After doing that a couple of times, the too many dimensions error is thrown.