kangguru / rack-google-analytics

Simple Rack middleware for implementing google analytics tracking in your Ruby-Rack based project. Supports synchronous and asynchronous insertion and configurable load options
MIT License
257 stars 53 forks source link

Added support for automatically setting of domain #12

Closed jarl-dk closed 10 years ago

jarl-dk commented 11 years ago

Setting domain automatically based on Rack request environment.

jarl-dk commented 11 years ago

I must admit I am a bit new to Google Analytics...

Is this Pull Request pointless? Is the google analytics behaviour provided with this:

    config.middleware.use Rack::GoogleAnalytics,{
      :tracker => 'UA-12345-1',
      :async => true,
      :multiple => true,
    }

exactly the same as this:

    config.middleware.use Rack::GoogleAnalytics,{
      :tracker => 'UA-12345-1',
      :async => true,
    }

I ask, because if so, the pull request seem pointless

kangguru commented 11 years ago

As the default behavior of setDomainName is auto which will try to obtain the current host from _setDomainName this will be pretty much the same. Only thing is that you'll have to also set the domain config if you use the multiple option.

jarl-dk commented 11 years ago

So your point is when not having multiple domains, the default behaviour is automatic domain detection and setting. Setting the domain option is only necessary when :multiple => true.

If so, maybe some description of this in the README would help.

kangguru commented 11 years ago

Thats how i get it :) I've added a bit to the README