Developers » AS2 tagging » Android » Users » User ID
User ID
Foreword
AT Internet’s SDK allows you to choose from three types of user ID in order to track your visitors. You can also choose to use a custom ID. You’ll be able to find this ID in the idclient variable present in hits.
Available identifications
The choice of type of ID to use is first made in the Tag Composer setup interface. It is also possible to modify this parameter directly in your application’s code. The different types are:
We recommend you to read the official Android best practices regarding the use of identifiers
UUID uuid
The SDK generates a unique ID (called UUID) for a user when s/he uses the application for the first time. It will then always be used, unless you change the type of ID, or unless the user deletes the application from his/her phone.
Since 2.18.0 SDK version, this identifier is renewed after 13 months by default (editable via
UUIDDuration
)
Android ID androidId
Default – The SDK retrieves this ID provided by Android. This ID is unique for each telephone (read more about exceptions). It will then always be used, unless you change ID type.
Google Advertising ID googleAdId
Available since version 2.15.0
The Advertising ID is the advertising identifier provided by Google. It is unique, but can be reset by the user.
To use the Advertising ID in your application, you must integrate, at a minimum, the Google Mobile Ads module of Google Play Services, following the procedure: https://developer.android.com/google/play-services/setup.html.
Huawei Open Advertising ID huaweiOAId
Available since version 2.15.0
The Open Advertising ID is the advertising identifier provided by Huawei via Huawei Mobile Services.
To use the Open Advertising ID in your application, you need to integrate at least the HUAWEI Ads Kit SDK module from Huawei Mobile Services, following the procedure: https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/19068235.
Advertising ID advertisingId
The Advertising ID uses the advertising identifier available depending on the environment. It tries to get the AdId from Google (see googleAdId), then the OAId from Huawei (see huaweiOAId).
With this mode of identification, the user will be considered as opt-out by default and therefore excluded from the analyses if he has activated limited ad tracking.
Since version 2.11.2, the AT Internet SDK allows this behavior to be modified using the ignoreLimitedAdTracking configuration key. When this configuration is active and the user has enabled limited ad tracking, the identification mode automatically switches to the UUID type.
Custom ID
With our SDK, you can force the use of a custom type of customer ID.
Limited AdTracking
The use of an advertising identifier (advertisingId, googleAdId or huaweiOAId) is subject to the user’s willingness to disable advertising tracking in which case the user cannot be identified.
By default, if the user activates limited ad tracking, it will be considered as opt-out, and will therefore be excluded from the analyses.
Since version 2.11.2, the AT Internet SDK allows you to modify this behavior using the ignoreLimitedAdTracking configuration key. When this configuration is active and the user has enabled limited ad tracking, the identification mode automatically switches to the UUID type.
Decision tree
Here is a diagram showing the decision tree of the user ID used by the SDK, depending on the configuration.

Tagging examples
For versions prior to 2.12.1, the SDK automatically switches to the Advertising ID if the format of predefined types is not respected: “androidId”, “advertisingId”, “UUID” (case sensitive).
Since version 2.12.1, the SDK automatically switches to the unique identifier (UUID) if the format of the predefined types is not respected: “androidId”, “advertisingId”, “UUID” (not case sensitive).
- Selecting Android ID as ID type
- Using the method setConfig()
ATInternet.getInstance().getDefaultTracker().setConfig("identifier", "androidId", new SetConfigCallback() { @Override public void setConfigEnd() { Log.d(null, "SDK is now using Android ID as visitor identifier"); } });
- Using the method setIdentifierType()
ATInternet.getInstance().getDefaultTracker().setIdentifierType(Tracker.IdentifierType.androidId, new SetConfigCallback() { @Override public void setConfigEnd() { Log.d(null, "SDK is now using Android ID as visitor identifier"); } });
- Using the method setConfig()
- Selecting Advertising ID as ID type
- Using the method setConfig()
ATInternet.getInstance().getDefaultTracker().setConfig("identifier", "advertisingId", new SetConfigCallback() { @Override public void setConfigEnd() { Log.d(null, "SDK is now using Advertising ID as visitor identifier"); } });
- Using the method setIdentifierType()
ATInternet.getInstance().getDefaultTracker().setIdentifierType(Tracker.IdentifierType.advertisingId, new SetConfigCallback() { @Override public void setConfigEnd() { Log.d(null, "SDK is now using Advertising ID as visitor identifier"); } });
- Activation of the configuration related to limited advertising tracking
ATInternet.getInstance().getDefaultTracker().setIgnoreLimitedAdTrackingEnabled(true, null, true);
- Using the method setConfig()
- Selecting UUID as ID type
- Using the method setConfig()
ATInternet.getInstance().getDefaultTracker().setConfig("identifier", "UUID", new SetConfigCallback() { @Override public void setConfigEnd() { Log.d(null, "SDK is now using UUID as visitor identifier"); } });
- Using the method setIdentifierType()
ATInternet.getInstance().getDefaultTracker().setIdentifierType(Tracker.IdentifierType.UUID, new SetConfigCallback() { @Override public void setConfigEnd() { Log.d(null, "SDK is now using UUID as visitor identifier"); } });
- Using the method setConfig()
- Selecting a custom ID
ATInternet.getInstance().getDefaultTracker().setParam("idclient", "123ABC");
Last update: 29/09/2020Examples of ID generated by default according to configuration (version 2.12.1 and higher):
ATInternet.getInstance().getDefaultTracker().setConfig("identifier", "", null, true); // &idclient=xxxxxxxxxxxxxxxx (androidId) ATInternet.getInstance().getDefaultTracker().setConfig("identifier", "error", null, true); // &idclient=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (UUID) ATInternet.getInstance().getDefaultTracker().setConfig("identifier", "androidId", null, true); // &idclient=xxxxxxxxxxxxxxxx (androidId) ATInternet.getInstance().getDefaultTracker().setConfig("identifier", "advertisingId", null, true); // &idclient=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (advertisingId) ATInternet.getInstance().getDefaultTracker().setConfig("identifier", "uuid", null, true); // &idclient=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (UUID)