Use analytical in mailers or models #40

Govinda-Fichtner opened this Issue Feb 1, 2012 · 2 comments


None yet

3 participants

It would be nice if analytical could be used from mailers and models in the same way as from controllers and views, too.
OK, after studying the code of the analytical gem I realized that all the tracking commands are called via javascript on the client side. Even for tracking commands in the controllers...
But even so I feel that it would be possible to make it work for models and mailer by using a library like http_party and a queue to make calls from the server side.
Would be interesting to know what others think about this....


This would be really helpful for me. Here's a concrete example:
I have a Subscription model, and I create it based on an opt-in box on my registration page.
But I'm using omniauth-identity to create the account, and so there's no controller for me, and I redirect to another page on success, so it is really hard for me to track this event the standard way.
I'd like to track the event in an after_create hook, rather than the controller.


I understand your need for this. I've felt the same in the past. However, at this point, I think it's out of the scope of this project. Analytical focuses on client-side javascript interaction exclusively, and it would be a big change in scope to add backend or email support at the moment.

I'm going to close this for now, and we can revisit it if need be in the future. Regardless, thanks for the suggestion! 👍

@sfsekaran sfsekaran closed this Apr 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment