Hello guys.
I need some help with ensuring Unity Analytics shows the actual number of users we have (vs. installs as happens by default). I found in a previous thread on this forum a suggestion to use Analytics.SetUserId and applied it but I still have some issues.
This is what I did: I created a Segment (“Irina Phone”) with one blank Custom Event, sent only by one of our developer’s phone by the DeviceUniqueIdentifier (sent also through Analitycs.SetUserId). However when I look at Data Explorer and I select only “Irina Phone” Segment, it shows multiple users in a single day corresponding to the number of installs on that same device. So my issue isn’t solved yet.
My questions are:
1 : What do I need to do to make a user ( in this example, “Irina Phone”) trully unique.
2 : How does Data Explorer counts the users, what id does it use?
For the record, SystemInfo.deviceUniqueIdentifier is always the same no matter how many installs are made so the problem isn’t from here.
Thanks.
1 Like
Can you show the code that you used for the Custom Event, and how you are using DeviceUniqueIdentifier? You can use Charles to watch events and parameters that are being sent
Thanks for the answer and for the link, it seems very usefull for my recent problem.
Here is the code:
public class AnalyticsManager
{
public AnalyticsManager()
{
Debug.Log(SystemInfo.deviceUniqueIdentifier);
AnalyticsResult res = Analytics.SetUserId(SystemInfo.deviceUniqueIdentifier);
Debug.Log("Unique id sent : " + res);
if (SystemInfo.deviceUniqueIdentifier == "Irina's unique device id")
{
Analytics.CustomEvent("Irina's Iphone7");
Debug.Log("Unique custom event sent for Irina");
}
}
}
This object was created on the first Awake() from my game and i was thinking that maybe Analytics API wasn’t initializated yet so for now it isn’t anymore in that Awake.
Ok, so i used Charles to view my events as they are sent from the game. Here are some screens that shows that Analytics.SetUserId is sent correcty but the next events doesn’t use that id.
Upon further investigation here, SetUserID is not used as the userID for subsequent Custom Event calls. The SetUserID value is only surfaced via Raw Data Export, in the UserInfo data set, and is used to map our userid with an id of the customer’s choosing. A new userid for Custom Events is created at first use and when another user logs onto the device and runs the app. However, if the app is reinstalled by a single user, then the userid would remain the same.
Hi, JeffD.
Many thanks for your answers, highly appreciated.
Please help me understand what is the best way to make sure Data Explorer displays one single user per device (the question that is actually burning us) as i undestand SetUserId might not be the best solution.
Also, regarding “However, if the app is reinstalled by a single user, then the userid would remain the same.” unfortunately this doesn’t happen. Please see below screenshots of user ids generated for the same device (my own) via different installs during yesterday. For each new install on the same device user id generates a new code.
Many thanks
Alex
Sorry for the confusion, you are correct. A reinstall will generate a new UserID. SetUserID should work for you, but would require Raw Data Export (a Pro feature)