Hi everyone! We have Rudderstack JS SDK implemente...
# support
f
Hi everyone! We have Rudderstack JS SDK implemented. Does anyone know how I can get the device id from the Rudderstack client? I think we need to pass it to the Amplitude experiment. Thank you!
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.
Hi Adrian, I don't think you can access the device ID from the browser.
f
Thank you for the reply. We have an Amplitude experiment integration but we are using Rudderstack for Analytics, and somehow I need to make sure they both use the same device id. Do you know if is possible to set one on Rudderstack?
m
Yes, but why not use the anonymous id as the device id. You can use the user transformation to add the property. You can use this https://www.rudderstack.com/docs/features/transformations/templates/#rename-properties
gratitude thank you 1
Hi Adrian I noticed that your team a paying customer of RudderStack. You can therefore use the internal channel between RudderStack and Carbmanager
f
Thank you! Sometimes we get faster answers here.
m
Oh ok. Where is your team based out of?
f
We are all remote.
m
I was asking since your TAM Emil is based in the US west coast
f
Yes, the company is based in US
m
Oh ok.
f
Hey again! Do you know how can I retrieve the
anonymousId
on Android? We are using
'com.rudderstack.android.sdk:core:1.7.1'
. Trying
RudderClient.getInstance()?.anonymousId
from the docs but it seems that is throwing an unresolved reference. Thank you!
m
This seems to be the way to get the anonymousId on Android. Can you share the error you are getting when you run this command?
f
Hey sorry for the late reply! It is an unresolved reference like `anonymousId`does not exist on
RudderClient.getInstance()
Copy code
public class RudderClient {
    // singleton instance
    private static RudderClient instance;
    // repository instance
    private static EventRepository repository;

    private static Application application;
    private static String _advertisingId;
    private static String _anonymousId;
    private static RudderOption defaultOptions;
    private static String _deviceToken;
Inspecting the RudderClient,
anonymousId
seems to be private
m
Let me check on this
Sorry I am not very familiar with Android, so you are saying that since anonymousId is private it wont be retrivable by the `RudderClient.getInstance()?.anonymousId`⁣ method?
f
Yes
m
But then why is it mentioned in the docs?
f
Not sure, maybe the docs were for a previous version?
m
Yes I am thinking the same. At some point the team may have made the anonymousId private, but did not update the docs.
Hi Adrian, the team mentioned that you are using a very old version of the SDK. Can you move to the latest version. This method should be supported in the latest version.
f
Thanks for your reply! I will check with the team if we can move to the latest version. Currently we are using
'com.rudderstack.android.sdk:core:1.7.1'
m
The latest version seems to be 1.20.1
gratitude thank you 1