macreery/analytical — pull request #1 by joeyAghion (2012-12-10 17:47:51+00:00)
Title: allow modules to be filtered in/out within javascript helpers

In the browser, it's helpful to be able to target providers when calling `Analytical.track` or `Analytical.event`. In our case, different providers are best suited to different types of analytics and might cap data volume at different levels.

This adds an optional final argument to the client-side javascript helpers. It's a generic `options` dictionary, but right now only one option is handled: `filterModules`. (This language is borrowed from the server-side helper with a similar purpose.) If provided, only the truthy providers in that dictionary will be invoked. E.g.:

Analytical.track('/some/url', {filterModules: {google: true}});
Analytical.event('A javascript event', {with: 'data'}, {filterModules: {google: true}});

I'm open to other suggestions, but this seemed like the most generic approach.