mixpanel / mixpanel-ruby

Other
172 stars 72 forks source link

Import functionality is broken #106

Open antulik opened 6 years ago

antulik commented 6 years ago

In short: import method succeeds but no data is stored.

Longer version

tracker.import('SECRET", '123', "Event", {"time" => 1517048470 })

This returns success result, but the event is not created in mixpanel.

Curl also does not work if api_key is passed as a param. For example

curl https://api.mixpanel.com/import \
-d data=abc \
-d verbose=1 \
-d api_key=123

The documentation uses curl example with basic authentication and it works like that: https://mixpanel.com/help/reference/importing-old-events

curl https://api.mixpanel.com/import \
-u YOUR_API_SECRET: \
-d data=eyJldmVudCI6ICIkc2lnbnVwIiwgInByb3BlcnRpZXMiOiB7ImRpc3RpbmN0X2lkIjogIjQ4MSIsICJ0aW1lIjogMTMyMTQ5OTM3MSwgInRva2VuIjogIjEzZmUzZGRjODZlYjZmOTBjNGVlN2QwZDQ3NTYzMTUwIn19 \
-d verbose=1

So my assumption that api_key param is ignored and basic authentication should be used instead

sugampandey commented 6 years ago

It does not work for us either.

jshow commented 5 years ago

thanks for the diagnosis @antulik

DataGreed commented 5 years ago

So, did mixpanel just dropped the support for it?

tony-schumacher commented 3 years ago

Does anybody got an update on this? If this is not fixed I will definitely chose a different product.

reinaris commented 3 years ago

@TonySchu I found a fix in the network graph https://github.com/LifeTales/mixpanel-ruby/commit/e9f425d53170689c537f52ecf6df0eb000d94740

Didn't tested it yet, but maybe it can help you.

reinaris commented 3 years ago

@TonySchu I found a fix in the network graph LifeTales@e9f425d

Didn't tested it yet, but maybe it can help you.

🤦 just saw @jshow already opened a PR for this https://github.com/mixpanel/mixpanel-ruby/pull/109. 2 years ago 😑

ts-mms commented 3 years ago

Thank you @reinaris. I am actually using the node implementation and it is a real bummer that this option is not working.

lloydwatkin commented 3 years ago

I've been running imports all morning and not seeing data, thought was me. This is pretty poor Mixpanel team!

enague commented 2 years ago

Hi everyone!

Eric from Mixpanel Support here, and I'm sorry about the confusion.

I tested this out on my own, and I'd like to suggest a quick troubleshooting method. Essentially, in the Mixpanel Ruby library, both the track method and profile update method are using the project token to authenticate, and as far as I know, the import method is the only method using both token and API key to authenticate.

Note: you can see when to use /track or /import here: https://developer.mixpanel.com/reference/track-event#when-to-use-track-vs-import

Therefore, I would double check that you are using the API Key (NOT THE API SECRET) in your requests. This can be found in your personal settings as described here: https://help.mixpanel.com/hc/en-us/articles/360000953003#accessing-personal-settings

I hope that helps, and sorry again for the inconvenience or confusion here.

gregawoods commented 1 year ago

I ran into this issue today. As far as I can tell, it seems like the implementation of import in this gem doesn't work. Wouldn't mind being proven wrong, though!

For now I am writing the request myself using Net::HTTP. I got it working fairly quickly that way.