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

OpenURI::HTTPError: 414 Request URI Too Long #100

Closed mrbrdo closed 11 years ago

mrbrdo commented 11 years ago

Hello,

I am getting the exception in the title when submitting a bit longer parameters with track. I guess the problem is you are probably submitting via GET and the parameters are too long.

Backtrace:

ruby-1.9.3-p374/lib/ruby/1.9.1/open-uri.rb:346→ open_http
ruby-1.9.3-p374/lib/ruby/1.9.1/open-uri.rb:775→ buffer_open
ruby-1.9.3-p374/lib/ruby/1.9.1/open-uri.rb:203→ block in open_loop
ruby-1.9.3-p374/lib/ruby/1.9.1/open-uri.rb:201→ catch
ruby-1.9.3-p374/lib/ruby/1.9.1/open-uri.rb:201→ open_loop
ruby-1.9.3-p374/lib/ruby/1.9.1/open-uri.rb:146→ open_uri
ruby-1.9.3-p374/lib/ruby/1.9.1/open-uri.rb:677→ open
ruby-1.9.3-p374/lib/ruby/1.9.1/open-uri.rb:33→ open
mixpanel-3.5.2/lib/mixpanel/tracker.rb:60→ request
mixpanel-3.5.2/lib/mixpanel/event.rb:27→ track_event
mixpanel-3.5.2/lib/mixpanel/event.rb:7→ track

As it's hard for me to determine the correct length (I'd have to convert to JSON string and do some guessing to split it up), it would really help me to get this handled in the gem itself. Perhaps you can use POST?

Thanks, Jan

zevarito commented 11 years ago

Hi @mrbrdo,

I think you are right: https://github.com/zevarito/mixpanel/blob/master/lib/mixpanel/tracker.rb#L60

Do you want to fix it and submit a pull request?

Thanks.

mrbrdo commented 11 years ago

I'm not sure how to approach it, I'd have to look into your API docs, but at the moment I'm swamped with work which has higher priority. I'll probably go with some quick workaround until then

zevarito commented 11 years ago

Yeah, that's cool. I am in the same situation as you right now. At first look it is a trivial change, but of-course time is needed to make it.

On Thu, May 23, 2013 at 12:29 PM, Jan Berdajs notifications@github.comwrote:

I'm not sure how to approach it, I'd have to look into your API docs, but at the moment I'm swamped with work which has higher priority. I'll probably go with some quick workaround until then

— Reply to this email directly or view it on GitHubhttps://github.com/zevarito/mixpanel/issues/100#issuecomment-18351031 .

Alvaro

mrbrdo commented 11 years ago

https://github.com/zevarito/mixpanel/pull/101