getSnowplowClient static method
Future<SnowplowTracker?>
getSnowplowClient({
- String? mid,
- Environment? environment,
- String? merchantType,
Implementation
static Future<SnowplowTracker?> getSnowplowClient({
String? mid,
Environment? environment,
String? merchantType,
}) async {
final snowplowTrackingEnabled = await cacheInstance.getValue(
cdnConfigInstance.getKeys(StorageKeyKeys.isSnowplowTrackingEnabled)!,
);
if (snowplowTrackingEnabled == 'true' &&
_snowplowClient == null &&
mid != null &&
environment != null) {
await initializeSnowplowClient(
mid: mid,
environment: environment,
merchantType: merchantType ?? 'shopify',
);
}
return _snowplowClient;
}