CLASS
ContextParamFactory
public class ContextParamFactory
Factory class for creating context parameters easily
Methods
url(_:)
public static func url(_ url: String) -> UrlLocationContextParam
Create a URL location context parameter - Parameter url: The URL string - Returns: URL location context parameter
Parameters
| Name | Description |
|---|---|
| url | The URL string |
ip(_:)
public static func ip(_ ip: String) -> IpContextParam
Create an IP address context parameter - Parameter ip: The IP address string - Returns: IP context parameter
Parameters
| Name | Description |
|---|---|
| ip | The IP address string |
deviceType(_:)
public static func deviceType(_ deviceType: String) -> DeviceTypeContextParam
Create a device type context parameter - Parameter deviceType: The device type (mobile, desktop, tablet) - Returns: Device type context parameter
Parameters
| Name | Description |
|---|---|
| deviceType | The device type (mobile, desktop, tablet) |
resolution(_:)
public static func resolution(_ resolution: String) -> ResolutionContextParam
Create a screen resolution context parameter - Parameter resolution: The screen resolution (e.g., "1920x1080") - Returns: Resolution context parameter
Parameters
| Name | Description |
|---|---|
| resolution | The screen resolution (e.g., “1920x1080”) |
userAgent(_:)
public static func userAgent(_ userAgent: String) -> UserAgentContextParam
Create a user agent context parameter - Parameter userAgent: The user agent string - Returns: User agent context parameter
Parameters
| Name | Description |
|---|---|
| userAgent | The user agent string |
browser(_:)
public static func browser(_ browser: String) -> BrowserContextParam
Create a browser context parameter - Parameter browser: The browser name - Returns: Browser context parameter
Parameters
| Name | Description |
|---|---|
| browser | The browser name |
browserLanguage(_:)
public static func browserLanguage(_ language: String) -> BrowserLanguageContextParam
Create a browser language context parameter - Parameter language: The browser language - Returns: Browser language context parameter
Parameters
| Name | Description |
|---|---|
| language | The browser language |
browserVersion(_:)
public static func browserVersion(_ version: String) -> BrowserVersionContextParam
Create a browser version context parameter - Parameter version: The browser version - Returns: Browser version context parameter
Parameters
| Name | Description |
|---|---|
| version | The browser version |
os(_:)
public static func os(_ os: String) -> OsContextParam
Create an operating system context parameter - Parameter os: The operating system name - Returns: OS context parameter
Parameters
| Name | Description |
|---|---|
| os | The operating system name |
language(_:)
public static func language(_ language: String) -> LanguageContextParam
Create a language context parameter - Parameter language: The language code - Returns: Language context parameter
Parameters
| Name | Description |
|---|---|
| language | The language code |
referrer(_:)
public static func referrer(_ referrer: String) -> ReferrerContextParam
Create a referrer context parameter - Parameter referrer: The referrer URL - Returns: Referrer context parameter
Parameters
| Name | Description |
|---|---|
| referrer | The referrer URL |
referrerType(_:)
public static func referrerType(_ referrerType: String) -> ReferrerTypeContextParam
Create a referrer type context parameter - Parameter referrerType: The referrer type (direct, referral, etc.) - Returns: Referrer type context parameter
Parameters
| Name | Description |
|---|---|
| referrerType | The referrer type (direct, referral, etc.) |
screen(_:)
public static func screen(_ screenName: String) -> ScreenContextParam
Create a screen context parameter (for mobile apps) - Parameter screenName: The screen name - Returns: Screen context parameter
Parameters
| Name | Description |
|---|---|
| screenName | The screen name |
utm(_:)
public static func utm(_ utmParams: [String: String]) -> UtmContextParam
Create UTM parameters context parameter - Parameter utmParams: Dictionary of UTM parameters - Returns: UTM context parameter
Parameters
| Name | Description |
|---|---|
| utmParams | Dictionary of UTM parameters |
custom(_:_:)
public static func custom(_ key: String, _ value: String) -> CustomContextParam
Create a custom context parameter - Parameters: - key: The custom parameter key - value: The custom parameter value - Returns: Custom context parameter
Parameters
| Name | Description |
|---|---|
| key | The custom parameter key |
| value | The custom parameter value |