mixpanel-ruby icon indicating copy to clipboard operation
mixpanel-ruby copied to clipboard

Import functionality is broken

Open antulik opened this issue 7 years ago • 10 comments

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

antulik avatar Feb 03 '18 11:02 antulik

It does not work for us either.

sugampandey avatar Apr 13 '18 22:04 sugampandey

thanks for the diagnosis @antulik

jshow avatar Dec 11 '18 16:12 jshow

So, did mixpanel just dropped the support for it?

DataGreed avatar Aug 12 '19 21:08 DataGreed

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

tony-schumacher avatar Jan 09 '21 09:01 tony-schumacher

@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 avatar Jan 13 '21 11:01 reinaris

@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 😑

reinaris avatar Jan 13 '21 12:01 reinaris

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

ts-mms avatar Jan 13 '21 15:01 ts-mms

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

lloydwatkin avatar May 14 '21 13:05 lloydwatkin

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.

enague avatar Feb 01 '22 22:02 enague

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.

gregawoods avatar Mar 09 '23 20:03 gregawoods