Refactor using extract method.

The getAnalyticsParameters() function was way too messy to be able to
refactor.
With this changes, we'll be able to implement multisite in the Analytics
module a lot easier.