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

Mixpanel break my javascript .. #66

Closed jeremybdk closed 11 years ago

jeremybdk commented 11 years ago

Hi, I am trying to get mixpanel working through javascript with the gem but I am getting a weird error in chrome or firefox : unexpected end of jquery.js

I believe there is an issue with the timing but don't know how to fix it here is how I do it :

Pockiz::Application.configure do config.middleware.use "Mixpanel::Middleware", ENV['MIX_PANEL'] end

then in my application.html.erb :

<% if user_signed_in? %> <%= javascript_tag do %> mixpanel.identify('<%= current_user.id%>'); mixpanel.name_tag('<%= current_user.full_name%>'); <% end %> <% end %>

I don't know what is going on but the error is Uncaught SyntaxError: Unexpected end of input

Thanks in advance for you help,

Is there a way to queue in delayed jobs the javascript event ?

Thanks,

zevarito commented 11 years ago

Jeremy,

Sorry I have not clue about what is happening with your issue, sadly I am under a terrible connection and couldn't access to internet for decent periods.

Well, no, at first thought you can't do that with jobs and js events.

On Thu, Dec 27, 2012 at 3:36 PM, Jeremy Bod notifications@github.comwrote:

Hi, I am trying to get mixpanel working through javascript with the gem but I am getting a weird error in chrome or firefox : unexpected end of jquery.js

I believe there is an issue with the timing but don't know how to fix it here is how I do it :

Pockiz::Application.configure do config.middleware.use "Mixpanel::Middleware", ENV['MIX_PANEL'] end

then in my application.html.erb :

<% if user_signed_in? %> <%= javascript_tag do %> mixpanel.identify('<%= current_user.id%>'); mixpanel.name_tag('<%= current_user.full_name%>'); <% end %> <% end %>
mixpanel.track(&#39 https://github.com/zevarito/mixpanel/issues/39;Page Viewed&#39 https://github.com/zevarito/mixpanel/issues/39;, {&#39https://github.com/zevarito/mixpanel/issues/39;Page Name&#39 https://github.com/zevarito/mixpanel/issues/39; : document.title, &#39 https://github.com/zevarito/mixpanel/issues/39;URL&

39 https://github.com/zevarito/mixpanel/issues/39; :

window.location.pathname});

I don't know what is going on but the error is Uncaught SyntaxError: Unexpected end of input

Thanks in advance for you help,

Is there a way to queue in delayed jobs the javascript event ?

Thanks,

— Reply to this email directly or view it on GitHubhttps://github.com/zevarito/mixpanel/issues/66.

Alvaro