Hello. Currently, Our integration is `RS->Mixpa...
# support
m
Hello. Currently, Our integration is
RS->Mixpanel
with device mode enabled. Is there an object inside the rudderstack instance that I can use to call mixpanel API directly?
m
Hey There! 👋 Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but we will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
h
hey again, not sure what you mean? with mp loaded you can just use 'mixpanel' that is on the global namespace
m
Hey Red! Sorry I am bombarding you guys with questions. In the global namespace? I am using javascript btw. You mean, like in the
window
object?
Thank you @hundreds-lifeguard-65770 didn't know about this! Seems like it is accessible! I assume this is only for integrations that are in device mode?
h
Correct since rudder loads the full mp js you can us it as you would normally however it wouldnt trigger other device integrations obviously
m
h
which function are you trying to call btw
m
ah. that one ^
h
aha 👍
m
now I just need to get the identity. along with the people props. Gonna be a bit off-topic here but do you have any idea how to do that? @hundreds-lifeguard-65770 Something maybe like
rudder.getCurrentIdentity()
?
h
never tried and that doesn't ring a bell, will look when back at my laptop
m
ok thank you 👍
h
try getUserTraits
depends how your identifying
m
Hmm. Yeah. It does work but it looks like I need to provide the trait on identify. I was expecting it to return all the other properties (that I used
set_once
) from Mixpanel's user profile
h
m
yeah I've seen this. The description is pretty vague though. So it says "You can identify the user traits without the
userId
if you wish to add the people properties in Mixpanel before knowing the
userId
. Does this mean I can "set" traits before even identifying? And once I identify, those pre-identified traits will be sent along with the identify call?
Like for example, in a signup page, I already have the email and username. I still don't have a user_id since the user haven't "finished" signing up yet. So calling
rudder.identify({ email, username })
will prepare those traits? or does it make an identify call already?
h
it will make an identify call but you could just use the email as id and pass the user_id as a trait when you have it
m
ah. so if I do
rudder.identify({ extra_non_pii_prop })
, It won't properly work since it needs a prop that can be used to merge with the upcoming
user_id
?
h
yeah
or use the email then id via alias
m
I see. Thanks Red. Now that we've discussed it, I can say I am approaching this improperly. Data should always be from my end and not from mixpanel. What I am trying to do is add a
total_searches
to existing Mixpanel people. Summing them up is a heavy task so what I wanted to do is once I
set_once
the
total_searches
prop, I want to "check" if it's already there (thus
getUserTraits
).