Developers » AS2 tagging » Android » Getting started » Configuration
Configuration
Foreword
To facilitate integration of your tag, the Tag Composer application allows you to configure and download our SDK.
These configuration variables are listed in the tracker’s defaultConfiguration.json file.
We recommend setting the configuration
secure
totrue
, since OS can block non-secure requests.
Editing the configuration
At any moment, you may change your tag’s configuration.
When creating a tracker:
Tracker mySpecificTracker = ATInternet.getInstance().getTracker("mySpecificTracker", new HashMap<String, Object>() {{ put("log","YOURLOG"); put("logSSL", "YOURSSLLOG"); put("domain", "YOURDOMAINLOG"); put("pixelPath", "/hit.xiti"); put("site", YOURSITEID); put("secure", true); put("identifier", "androidId"); put("enableCrashDetection", true); put("plugins", "tvtracking"); put("storage", "required"); put("hashUserId", false); put("persistIdentifiedVisitor", true); put("campaignLastPersistence", false); put("campaignLifetime", 30); put("sessionBackgroundDuration", 60); }});
Via use of the tracker’s setConfig method:
Please note, the setConfig method is an asynchronous method. To ensure that the configuration was successfully applied, a callback indicating that the configuration was successfully applied is available.
- Modification of a configuration key:
tracker.setConfig("secure", true, new SetConfigCallback() { @Override public void setConfigEnd() { Log.d(null, "Tracker is now using SSL"); } });
- Replacement of certain configuration keys:
Only keys passed as parameters will be modified or added to the existing configuration
HashMap config = new HashMap<String, Object>() {{ put("site", YOURSITEID); put("secure", true); put("identifier", "androidId"); }}; tracker.setConfig(config, false, new SetConfigCallback() { @Override public void setConfigEnd() { Log.d(null, "Configuration is now set"); } });
Since 2.2.0 version, it’s possible to use helpers and constants to simplify configuration management.
- Samples to use helpers
// Log ATInternet.getInstance().getDefaultTracker().setLog("YOURLOG", new SetConfigCallback() { @Override public void setConfigEnd() { Log.d("TAG", "Your new log is set"); } }); // Secured log ATInternet.getInstance().getDefaultTracker().setSecuredLog("YOURSSLLOG", new SetConfigCallback() { @Override public void setConfigEnd() { Log.d("TAG", "Your new secured log is set"); } }); // Site id ATInternet.getInstance().getDefaultTracker().setSiteId(YOURSITEID, new SetConfigCallback() { @Override public void setConfigEnd() { Log.d("TAG", "Your new site id is set"); } });
- Samples to use constants (all constants are available in TrackerConfigurationKeys class)
// Log ATInternet.getInstance().getDefaultTracker().setConfig(TrackerConfigurationKeys.LOG, "YOURLOG", new SetConfigCallback() { @Override public void setConfigEnd() { Log.d("TAG", "Your new log is set"); } }); // Secured log ATInternet.getInstance().getDefaultTracker().setConfig(TrackerConfigurationKeys.LOG_SSL, "YOURSSLLOG", new SetConfigCallback() { @Override public void setConfigEnd() { Log.d("TAG", "Your new secured log is set"); } }); // Site id ATInternet.getInstance().getDefaultTracker().setConfig(TrackerConfigurationKeys.SITE, YOURSITEID, new SetConfigCallback() { @Override public void setConfigEnd() { Log.d("TAG", "Your new site id is set"); } });
List of variables
Name | Default value | Description |
---|---|---|
log | – | Sets the hit collect log |
logSSL | – | Sets the secure hit collect log |
domain | xiti.com | Sets the domain of the collect log |
pixelPath | /hit.xiti | Sets the path of the transparent pixel |
site | – | Sets the site ID |
secure | false | Enables use of SSL mode |
identifier | androidId | Sets type of user ID (androidId, advertisingId,UUID) |
storage | never | Sets mode of hit storage (required, never, always) |
enableCrashDetection | true | Enables recovery crash application information |
hashUserId | false | Enables hashing of user ID (sha256) |
persistIdentifiedVisitor | true | Enables storage of identified user information (numerical or text) |
plugins | – | Enables one or several plugins (e.g: tvtracking,nuggad). Plugins are separated by commas |
campaignLifetime | 30 | Sets campaign lifetime (by default: 30 days) |
campaignLastPersistence | false | Sets the mode of prior attribution (by default, subsequent actions will be attributed to the first campaign detected) |
sessionBackgroundDuration | 60 | Sets the duration, in seconds, between two sessions after the app enters in background |
ignoreLimitedAdTracking | true | Allows to take into account the limited ad tracking OS configuration: hits will be considered as opt-out (true), otherwise a GUID will be used for user identification (false). Since v2.11.2 |
sendHitWhenOptOut | true | Allows sending anonymous hits when the user is in “opt-out” mode. Since v2.12.0 |
UUIDDuration | 397 | (UUID) Define UUID lifetime |
UUIDExpirationMode | fixed | (UUID) Define UUID expiration mode (possible values : fixed, relative) |