Skip to content

Integrations field is empty in segment analytics #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
MiguelBelotto00 opened this issue Apr 4, 2025 · 2 comments
Open

Integrations field is empty in segment analytics #152

MiguelBelotto00 opened this issue Apr 4, 2025 · 2 comments

Comments

@MiguelBelotto00
Copy link

MiguelBelotto00 commented Apr 4, 2025

Hello everyone, I've been testing this package and I'm correctly instantiating analytics, as well as adding the AppsFlyer plugin. However, when the event is sent to Segment Twilio, the integration section appears as null.

For example:

//AnalyticsSegment is a singleton when contains the analytics class
AnalyticsSegment().analytics.addPlugin(
  AppsFlyerDestination(),
  settings: {
    'appleAppID': value,
    'appsFlyerDevKey': myKey,
    'httpFallback': false,
    'rokuAppID': null,
    'trackAttributionData': true,
    'type': 'mobile',
    'versionSettings': {
      'prod': [
        appVersion,
      ],
    },
  },
);

Now, if I do:

AnalyticsSegment().analytics.track('event', properties: myProperties)

In Segment, I see that the value of the integrations map is empty, even though I added AppsFlyer:

  "integrations": {}

Packages:
segment_analytics_plugin_appsflyer: ^1.0.1
segment_analytics: ^1.1.4

@MiguelBelotto00
Copy link
Author

Maybe the problem is here:
Image

@neelkanth-kaushik
Copy link

Hello @MiguelBelotto00 , We're currently testing the changes you suggested.

We've observed that the integrations field in the segment is no longer empty, but it still doesn't include AppsFlyer, even after adding its plugin.

I am pasting a snapshot of integrations: {} for your reference. Could you please confirm if this is the expected behavior you were aiming for?

"integrations": {
    "Segment.io": {
      "apiKey": "***************************",
      "unbundledIntegrations": [],
      "addBundledMetadata": true,
      "maybeBundledConfigIds": {},
      "versionSettings": {
        "version": "4.4.7",
        "componentTypes": [
          "browser"
        ]
      },
      "apiHost": "api.segment.io/v1"
    }
  },

For your reference, below is the code in our main.dart file:-

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  const segmentWriteKey = '**************************';

  // Initialize the Segment client with your write key
  final analytics = createClient(
    Configuration(
        segmentWriteKey,
        debug: true, // Enable debug logs
        flushPolicies: [
          CountFlushPolicy(10),
          TimerFlushPolicy(100)
        ],
        collectDeviceId: true
      ),
  );

  // analytics.addPlugin(MyCustomContext());  // Add custom context plugin
  analytics.addPlugin(AppsFlyerDestination(), settings: {
    'appsFlyerDevKey': '*****************************',
    'httpFallback': false,
    'rokuAppID': null,
    'trackAttributionData': true,
    'type': 'mobile',
  });
  runApp(MyApp(analytics: analytics)); // Pass the analytics client here
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants