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 to true, 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.

  1. Modification of a configuration key:
    tracker.setConfig("secure", true, new SetConfigCallback() {
          @Override
          public void setConfigEnd() {
              Log.d(null, "Tracker is now using SSL");
          }
    });
  2. 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");
           }
    });
  3. Complete change of configuration:

    The existing keys will be deleted and replaced by the new keys passed as parameters

    HashMap config = new HashMap<String, Object>() {{
                put("log", "YOURLOG");
                put("logSSL", "YOURSSLLOG");
                put("site", YOURSITEID);
                put("secure", true);
                put("hashUserId", false);
                put("storage", "required");
                put("pixelPath", "/hit.xiti");
                put("plugins", "tvtracking");
                put("domain", "YOURDOMAINLOG");
                put("identifier", "androidId");
                put("persistIdentifiedVisitor", true);
                put("enableCrashDetection", true);
                put("campaignLastPersistence", true);
                put("campaignLifetime", 1);
                put("sessionBackgroundDuration", 10);
            }};
    
    tracker.setConfig(config, true, 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.

  1. 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");
                }
            });
  2. 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

NameDefault valueDescription
logSets the hit collect log
logSSLSets the secure hit collect log
domainxiti.comSets the domain of the collect log
pixelPath/hit.xitiSets the path of the transparent pixel
siteSets the site ID
securefalseEnables use of SSL mode
identifierandroidIdSets type of user ID (androidId, advertisingId,UUID)
storageneverSets mode of hit storage (required, never, always)
enableCrashDetectiontrueEnables recovery crash application information
hashUserIdfalseEnables hashing of user ID (sha256)
persistIdentifiedVisitortrueEnables storage of identified user information (numerical or text)
pluginsEnables one or several plugins (e.g: tvtracking,nuggad). Plugins are separated by commas
campaignLifetime30Sets campaign lifetime (by default: 30 days)
campaignLastPersistencefalseSets the mode of prior attribution (by default, subsequent actions will be attributed to the first campaign detected)
sessionBackgroundDuration60Sets the duration, in seconds, between two sessions after the app enters in background
ignoreLimitedAdTrackingtrueAllows 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
sendHitWhenOptOuttrueAllows sending anonymous hits when the user is in “opt-out” mode. Since v2.12.0
 

Was this post helpful?

Last update: 28/05/2019