Skip to content

Appsflyer help #99

@GeorgePagMezzi

Description

@GeorgePagMezzi

Hello, I just switched over from deprecated Segment package to this one and would like to also include Appsflyer support in order to track attribution data through Segment in my ios app. In my Segment dashboard I have added the 'Appsflyer' destination and included the Apple APP ID, Appsflyer Dev Key andhave enabled 'Track Attribution Data' option. Code on the FE looks like this:

final clientAnalytics = createClient(
  Configuration(
    "KEY",
    /// This is set to false to avoid swarming the console messages. If Segment debug is needed set it to true.
    debug: false,
    trackApplicationLifecycleEvents: true,
    trackDeeplinks: true,
  ),
);
clientAnalytics.addPlugin(AppsFlyerDestination());

Sadly the attribution does not work on Segment side with this setup (even though deprecated package was somewhat consistent with attribution). Is there anything more I should do? E.G. create an appsflyerDestination object and manually input the settings?

final AppsFlyerDestination appsFlyerDestination = AppsFlyerDestination();
appsFlyerDestination.appsFlyerSettings = AppsFlyerSettings(
        appleAppID, appsFlyerDevKey, httpFallback, rokuAppID, trackAttributionData, type, versionSettings);
clientAnalytics.addPlugin(appsFlyerDestination);

When should I run the identify method of AppsFlyerDestination class? I also notice that in your docs it says: 'When you send this flag the plugin_appsflyer SDK ignores attribution. What does it mean when you say 'send' (do you mean 'set')? is the plugin_appsflyer sdk the same as segment_analytics_plugin_appsflyer?
image

Also if I Restart the app, I get below error. I have declared the clientAnalytics variable globally.

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
#0 AppsFlyerDestination.identify (package:segment_analytics_plugin_appsflyer/plugin_appsflyer.dart:61:16)
plugin_appsflyer.dart:61
#1 EventPlugin.execute (package:segment_analytics/plugin.dart:52:16)
plugin.dart:52
#2 DestinationPlugin.process (package:segment_analytics/plugin.dart:163:17)
plugin.dart:163

Thank you in advance and remain at your disposal to provide further info.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions