iOS SDK: Change TrackID and Track Domain on Runtime
    • 1 Minute to read
    • Dark
      Light

    iOS SDK: Change TrackID and Track Domain on Runtime

    • Dark
      Light

    Article summary

    Track IDs and domains are essential to track user behavior with the Intelligence SDK on a mobile application and must be added during configuration. Sometimes, it can be necessary to change the already configured settings on runtime. For example, when offering to use the mobile application in various languages and analyzing each language in a separate account.

    This can now easily be achieved by calling the iOS SDK method. The method is available as of iOS SDK version 5.0.3.

    Please note that changing accounts on runtime will affect the entry and exit pages in the analyses, and may increase the number of bounces. Please consult with your customer success manager before using this feature.

    Methods

    Method

    Description

    - (void)setIdsAndDomain:(NSArray *)trackIDs onTrackdomain:(NSString *)trackDomain 

    Method to be called when changing track IDs and track domains on runtime.

    Examples

    import UIKit
    
    class RuntimeConfigurationViewController: UIViewController {
        
        override func viewDidLoad() {
            super.viewDidLoad()
        	MappIntelligence.shared()?.setIdsAndDomain(trackIDs, onTrackdomain: trackDomain)
        }
    
    }
    
    
    #import "RuntimeConfigurationViewController.h"
    #import "MappIntelligence.h"
    
    @interface RuntimeConfigurationViewController ()
    
    @end
    
    @implementation RuntimeConfigurationViewController
    
    - (void)viewDidLoad {
        [super viewDidLoad];
        // Do any additional setup after loading the view.
        [[MappIntelligence shared] setIdsAndDomain:trackIDs onTrackdomain:trackDomain];
    }
    @end

    Limitations

    • This function changes the tracking-id and domain only during the session. To keep the same setup when the application starts again, you need to pass the same data to the main configuration function. More information here: Initialization.

    • It is possible that there will be a short delay when changing settings.

    • We don't recommend using the function with the same track ID which is already being used (e.g. when using multiple Account IDs and you only want to change one of them)

    • Please do not use this function more than once in 5 seconds. Frequent use can cause unwanted SDK behavior.


    Was this article helpful?

    What's Next