parent
e7b46433ff
commit
397032595d
5 changed files with 83 additions and 19 deletions
@ -0,0 +1,18 @@ |
||||
from mixpanel import Mixpanel |
||||
|
||||
from django.conf import settings |
||||
|
||||
from project.celery import app |
||||
|
||||
|
||||
@app.task |
||||
def transaction_to_mixpanel(user_id, amount, time, product_type): |
||||
mix = Mixpanel(settings.MIX_TOKEN) |
||||
mix.people_track_charge( |
||||
user_id, |
||||
amount, |
||||
{ |
||||
'$time': time, |
||||
'product_type': product_type, |
||||
} |
||||
) |
||||
@ -0,0 +1,20 @@ |
||||
from mixpanel import Mixpanel |
||||
|
||||
from django.conf import settings |
||||
|
||||
from project.celery import app |
||||
|
||||
|
||||
@app.task |
||||
def user_to_mixpanel(user_id, email, first_name, last_name, date_joined, role): |
||||
mix = Mixpanel(settings.MIX_TOKEN) |
||||
mix.people_set( |
||||
user_id, |
||||
{ |
||||
'$email': email, |
||||
'$first_name': first_name, |
||||
'$last_name': last_name, |
||||
'$created': date_joined, |
||||
'role': role, |
||||
} |
||||
) |
||||
Loading…
Reference in new issue