Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "Requested 15 dimensions; only 7 are allowed." often #129

Open
jasperkennis opened this issue Dec 27, 2012 · 0 comments
Open

Getting "Requested 15 dimensions; only 7 are allowed." often #129

jasperkennis opened this issue Dec 27, 2012 · 0 comments

Comments

@jasperkennis
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant