Search code examples
djangopython-3.xpython-2.7mixpanel

how to create hook from python to send data to mixpanel using dev token


I want to create a hook from my python code to send user data to mixpanel from signals.py in login and logout. Seen examples using api key and secret keys but I have only the dev auth token.

Also i want to retrieve data from that hook later on


Solution

  • mp = Mixpanel(<PROJECT_TOKEN>)
    mp.track(<unique id>, <Event name>, <event data json>)