refinery/refinerycms — pull request #2079 by jemiahlee (2012-12-13 22:49:06+00:00)
Title: Adding the ability to use arbitrary Google Analytics parameters

We needed to add the domainName parameter to our Google Analytics setup and thought others might need to, too. Now instead of taking just a string as that parameter, it can instead take a hash which it will destructure into the string format expected in the Javascript for GA.

We didn't want to rename the parameter or add another parameter name, though that is probably the right way to do it; if you think that's worth our time, please add a note and we can add that in to an updated pull request.

We wrote a test for this, but we couldn't figure out a way to stub local_request? or refinery_user? in our test; we monkeypatched the methods onto Object to ensure that they would get called. Ideas on how to do this would be most welcome, and we can submit that too.

Thanks!