zevarito / mixpanel

Simple lib to track events in Mixpanel service. It can be used in any rack based framework.
MIT License
273 stars 84 forks source link

Having a little trouble with append_track #107

Closed Jayphen closed 11 years ago

Jayphen commented 11 years ago

I'm trying to use the middleware to output JavaScript to the view.

I'm using mixpanel.append_track in my controller. I've used binding.pry to debug, and can see that the event is being added to the queue, however there is no JavaScript being inserted in my view.

I'm sure I am misunderstanding something. My expectation is that a script tag will be rendered in the view, and I should see the event logged to the console (I'm using debug: true)

Jayphen commented 11 years ago

I figured it out – I wasn't correctly instantiating the mixpanel object in application_controller.