Solved

import historical data such as user events


I want to import historical data such as user events. I need to have events which occurred before setting mixpanel with this project. I tried with https://mcgaw.io/tools/segment-amplitude-mixpanel-csv-historical-offline-user-data-import/#tool-section, but I’ve got the message “data was sent” and the error in console that my csv file is not in correct format.

Maybe somebody have done the historical data import to mixpanel and have advices or link to better importer?

icon

Best answer by app_analytics_rocks 17 June 2021, 18:31

View original

16 replies

Userlevel 6
Badge +3

You have a few options for importing past events —

Two of them include:

As a rule of thumb, you may see “success” messages as a way to shield a user from trying to guess at credentials. So if you are seeing messages like this, but you do not see any data, I would confirm that you are using the correct credentials — for example, you may need the token instead of the secret or vice versa. 

I used the "import" API to import events in batches of 50. it only works if the events have a "Time" property which is between today and 5 days before.

If I try to import events older than 5 days, they do not appear on my report even though the response from your API is equal to 1. (authentication + data are OK)

I want to import events from an old project into a new one and it's very difficult. Why is it so difficult when it is a basic feature !?

Userlevel 1
Badge +3

Likewise @Hydrisbessa 

I was able to import events using batch events, but since it’s only possible for events that happened in the past 5 days it would not suffice my needs.

The problem is that Import events is not working, for no apparent reason. It is returning a success message (like the batch API that I could previously run) but no event is added to my project (both secret key and project key were added). I’m doing it directly from the browser (even though I previously tried from a Python client).

Another question (probably relevant when I solve this): Could you point me to the way the payload data is encoded to be served to the import API? I’m using urllib in Python but is not returning the same result as in the browser

Hello,

 

I am having the same issue, can’t import previous data at all and getting status 200 from https://developer.mixpanel.com/reference/events#import-events or from python client.

 

Did anyone manage to do it?

 

Thanks.

Userlevel 1
Badge +3

In my case the problem had to due with a European config. All solved now

In this docs it states that you can import data up to 5 years old.

Is this not true?

I am interested in implementing MixPanel but this functionallity is crucial to me, I expect my clients to be offline for more than 5 days.  

Thank you very much for your clarification.

I am also facing the same issue. I get success 200 message along with correct import count but I don’t see the imported events in backend. However it does show the count of imported events in listings. Initially I thought maybe there is some filter which is causing this but removing all filters also does not help.

It says “Showing X most recent results of Y matches” where Y shows the correct count but doesn’t show the events.

Badge

Same issue here! Import results with 200 but if time property is set back more than a few days, events don’t show up. works with a current timestamp.

In my case, the issue was not with import but rather the fact that you need to select the exact time internal in events filter. For example, I imported events for June 2021 only but in filters I had June 2021 to Dc 2021 selected. It was showing the count but not the events. When I selected dates as June 21 to June 21 then it started showing.

It’s an issue with Mixpanel that it has this discrepancy in showing the result count and showing the actual results. Counts are correct and if it shows the count then it should also show the actual events.

Badge

In my case, the issue was not with import but rather the fact that you need to select the exact time internal in events filter. For example, I imported events for June 2021 only but in filters I had June 2021 to Dc 2021 selected. It was showing the count but not the events. When I selected dates as June 21 to June 21 then it started showing.

It’s an issue with Mixpanel that it has this discrepancy in showing the result count and showing the actual results. Counts are correct and if it shows the count then it should also show the actual events.

I double checked that. I have set the filter back to 1999, no luck. I heard it could be something related to EU users? If yes, this should be documented!

How do you send events (a user's track - for example "User Registered") using CSV? He succeeds in the Lexicon but does not appear in the events.

Badge

I figured out. It’s mandatory to use the EU API Url.

This makes sense. But it’s confusing as the request still works, returns a 200 and sometimes even imports the data.

Sometimes means if the `time` property is not older than a few days (did not check in details)

Suggestion: @Mixpanel:

  • Check the incoming API url, compare it with the projects EU setting and reject it completely! Would be a simple solution and prevents surprises on both sides.
  • At the “Import Events” docs page: Improve the UI of the Base Url field. It looks like a simple label but actually you can click on that field to change the Base Urls to the EU. Would have saved me hours. https://developer.mixpanel.com/reference/import-events

I have tried it with:

  • EU API Url
  • Event alone and in Batches
  • Both in JSON array and as Base64 decoded

None of those cases worked to import events older than 5 days ago. What would be the suggestion from @Mixpanel to import those historic information?

The issue is still there? Can I send events older than 5 days ago?

Hi, i’m also getting strange results when batch importing to segment.io and then having that data pushed to mixpanel. It seems the issue is to do with historical data.

Could someone from Mixpanel response to all these issues?

Hello, I am having the same issue here and cannot import historical events in my project. Can you please help in this topic? @mixpanelsolutions 

Reply