{"issue":{"created_at":"2011-11-28T17:29:19Z","state":"open","updated_at":"2011-11-29T03:43:56Z","user":{"gravatar_id":"e16a163c065b5a82ee75f9ce9712b160","id":794163,"url":"https://api.github.com/users/smidwap","avatar_url":"https://secure.gravatar.com/avatar/e16a163c065b5a82ee75f9ce9712b160?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"smidwap"},"comments":2,"body":"Hi, ran into another issue: weird things happen if I am both using the mixpanel gem and manually coding mixpanel events in my views. The problem occurs if I am tracking events in the \"head\" tag. The mixpanel gem will insert another mixpanel initialization script (i.e. setting up the \"mpq\" variable) before the end of the head tag, which stops my events from being tracked. So, the head code looks something like:\r\n\r\nInit mixpanel manually\r\nTrack some events\r\nMixpanel gem inserts another mixpanel init script\r\n\r\nThe problem is fixed if I move my event tracking to the body tag, but it seems like there should be an option to stop the gem from insert the mixpanel init script.","assignee":null,"id":2370652,"number":22,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"No option to stop inclusion of javascript initialization","closed_at":null,"html_url":"https://github.com/zevarito/mixpanel/issues/22","url":"https://api.github.com/repos/zevarito/mixpanel/issues/22","milestone":null},"action":"created","comment":{"created_at":"2011-11-29T03:43:56Z","updated_at":"2011-11-29T03:43:56Z","user":{"gravatar_id":"e16a163c065b5a82ee75f9ce9712b160","id":794163,"url":"https://api.github.com/users/smidwap","avatar_url":"https://secure.gravatar.com/avatar/e16a163c065b5a82ee75f9ce9712b160?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"smidwap"},"body":"I'm not so sure there is a great reason. I am learning how to integrate\nRails & mixpanel for the first time, and it's an interesting undertaking.\nFor example, I've found several cases where I need to track events in\nModels instead of Controllers. The mixpanel gem isn't really set up to do\nthat, but I'm figuring it out.\n\nOn Mon, Nov 28, 2011 at 1:03 PM, Alvaro Gil <\nreply@reply.github.com\n> wrote:\n\n> If you are using the gem, which is the reason to track events outside the\n> gem?\n>\n> Yes, probably an option to no include mixpanel lib may work, pull requests\n> with tests are welcome.\n>\n> ---\n> Reply to this email directly or view it on GitHub:\n> https://github.com/zevarito/mixpanel/issues/22#issuecomment-2904347\n>\n\n\n\n-- \n*\nMatt De Leon / ASSOCIATE PARTNER\n219.309.0213\n\nCELL\n\n\n |\n  @naivethought\n\nDeveloperTown  TURN YOUR IDEA INTO A BUSINESS\ndevelopertown.com  |  855.338.8696  |  @developertown\n*","id":2911727,"url":"https://api.github.com/repos/zevarito/mixpanel/issues/comments/2911727"}}