ConnectivityData

The ConnectivityData module is a Collector module that automatically enriches tracking data with network connectivity information. This module monitors the device’s internet connection status and type, providing real-time connectivity data for all tracking events.

Collected Data Points

The ConnectivityData module collects the following information:

Data Point Key Description Source
Connection Type connection_type Current network connection type (e.g., “wifi”, “cellular”, “ethernet”, “none”) System connectivity monitor

Installation/Configuration

The ConnectivityData module can be configured using three different approaches:

Local and Remote Settings

Configure the module using local JSON settings file (via settingsFile parameter) and/or remote settings (via settingsUrl parameter):

var config = TealiumConfig(account: "tealiummobile",
                          profile: "your-profile", 
                          environment: "dev",
                          settingsFile: "TealiumSettings",
                          settingsUrl: "https://tags.tiqcdn.com/dle/tealiummobile/lib/example_settings.json")

Default initialization - module will be initialized only if configured in settings file specified:

{
    "modules": {
        "ConnectivityData": {
            "module_type": "ConnectivityData"
        }
    }
}

Custom configuration - module with specific settings:

{
    "modules": {
        "ConnectivityData": {
            "module_type": "ConnectivityData",
            "enabled": true,
            "order": 1,
            "rules": {
                "operator": "and",
                "children": [
                    "rule_id_from_settings"
                ]
            }
        }
    }
}

When both local and remote settings are provided, they are deep merged with remote settings taking priority.

Programmatic Configuration

Configure the module programmatically by adding it to the modules parameter in TealiumConfig.

Default initialization - module will be initialized with default settings:

let config = TealiumConfig(account: "tealiummobile",
                          profile: "your-profile", 
                          environment: "dev",
                          modules: [
                              Modules.connectivityData(),
                              // other modules...
                          ])

Custom configuration - module with enforced settings:

let config = TealiumConfig(account: "tealiummobile",
                          profile: "your-profile", 
                          environment: "dev",
                          modules: [
                              Modules.connectivityData(forcingSettings: { builder in
                                  builder.setEnabled(true)
                                         .setOrder(1)
                                         .setRules(.and(["rule_id_from_settings"]))
                              }),
                              // other modules...
                          ])

⚠️ Important: Programmatic settings are deep merged onto local and remote settings and will always take precedence. Only provide programmatic settings for configuration values that you never want to be changed remotely, as they will override any remote updates.

Settings Builders Reference

The ConnectivityData module uses the ConnectivityDataSettingsBuilder for configuration. This is an extension of the CollectorSettingsBuilder which offers common settings like: