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.xml file.

 

Editing the configuration

At any moment, you may change your tag’s configuration.

When creating a tracker:

Tracker specificTracker = SmartTag.Instance.Tracker("mySpecificTracker", new Dictionary<string, string>()
    {
        { "log","YOURLOG" },
        { "logSSL","YOURSSLLOG" },
        { "domain","YOURDOMAINLOG" },
        { "site", "YOURSITEID" },
        { "pixelPath","/hit.com" },
        { "secure","false" },
        { "identifier","deviceId" },
        { "storage","required" },
        { "hashUserId","false" },
        { "campaignLastPersistence","false" },
        { "campaignLifetime","30" },
        { "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("identifier", "deviceId", this);
    public void TrackerReady()
    {
         System.Diagnostics.Debug.WriteLine("config set");
    }
    public sealed partial class MainPage : Page, TrackerReadyHandler

     

  2. Replacement of certain configuration keys:

    Only keys passed as parameters will be modified or added to the existing configuration

    Dictionary<string, string> config = new Dictionary<string, string>()
    {
          {"site", "YOURSITEID" },
          {"secure", "false" },
          {"identifier", "winId" },
    };
    tracker.SetConfig(config, false, this);

     

  3. Complete change of configuration:

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

    Tracker specificTracker = SmartTag.Instance.Tracker("mySpecificTracker", new Dictionary<string, string>()
        {
            { "log","YOURLOG" },
            { "logSSL","YOURSSLLOG" },
            { "domain","YOURDOMAINLOG" },
            { "site", "YOURSITEID" },
            { "pixelPath","/hit.com" },
            { "secure","false" },
            { "identifier","winId" },
            { "storage","required" },
            { "hashUserId","false" },
            { "campaignLastPersistence","false" },
            { "campaignLifetime","30" },
            { "sessionBackgroundDuration","10" }
        }
    );
    specificTracker.SetConfig(config, true, this);
    

     

 

Since 1.2.0 version, it’s possible to use helpers and constants to simplify configuration management.

  1. Samples to use helpers
    // Log
    SmartTag.Instance.defaultTracker.SetLog("YOURLOG", this);
    
    // Secured log
    SmartTag.Instance.defaultTracker.SetSecuredLog("YOURSSLLOG", this);
    
    // Site id
    SmartTag.Instance.defaultTracker.SetSiteId(YOURSITEID, this);

     

  2. Samples to use constants (all constants are available in TrackerConfigurationKeys class)
    // Log
    SmartTag.Instance.defaultTracker.SetConfig(TrackerConfigurationKeys.LOG, "YOURLOG", this);
    
    // Secured log
    SmartTag.Instance.defaultTracker.SetConfig(TrackerConfigurationKeys.LOG_SSL, "YOURSSLLOG", this);
    
    // Site id
    SmartTag.Instance.defaultTracker.SetConfig(TrackerConfigurationKeys.SITE, "YOURSITEID", this);
 

List of variables

NameDefault valueDescription
logSets the hit collect log
logSSLSets the secure hit collect log
domainxiti.comSets the domain of the collect log
pixelPathSets the path of the transparent pixel
siteSets the site ID
securefalseEnables use of SSL mode
identifierdeviceIdSets type of user ID (deviceId, guid)
storageneverSets mode of hit storage (required, never, always)
hashUserIdfalseEnables hashing of user ID (sha256)
persistIdentifiedVisitortrueEnables storage of identified user information (numerical or text)
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
 

Was this post helpful?

Last update: 09/06/2017