Simple Rack middleware for implementing google analytics tracking in your Ruby-Rack based project. Supports synchronous and asynchronous insertion and configurable load options
We had a set of scenarios in which we wanted an application to be able dynamically specify the tracking code based on whatever business logic needed to govern it. This PR adds support for optionally passing a lambda that provides the tracking code at runtime based on the Rack environment.
We had a set of scenarios in which we wanted an application to be able dynamically specify the tracking code based on whatever business logic needed to govern it. This PR adds support for optionally passing a lambda that provides the tracking code at runtime based on the Rack environment.
With this change a site can define a tracker like
and then vary the tracking code dynamically based on whatever logic it wants, a contrived example being: