flutter_acpanalytics 2.0.1 copy "flutter_acpanalytics: ^2.0.1" to clipboard
flutter_acpanalytics: ^2.0.1 copied to clipboard

discontinued
PlatformAndroidiOS

Official Adobe Experience Platform support for Flutter apps. The Analytics extension allows for integration with Adobe Analytics.

flutter_acpanalytics #

pub package Build License

flutter_acpanalytics is a flutter plugin for the iOS and Android AEP Analytics SDK to allow for integration with flutter applications. Functionality to enable the Analytics extension is provided entirely through Dart documented below.

Installation #

Install instructions for this package can be found here.

Note: After you have installed the SDK, don't forget to run pod install in your ios directory to link the libraries to your Xcode project.

Tests #

Run:

flutter test
copied to clipboard

Usage #

Analytics #

Importing the SDK:
import 'package:flutter_acpanalytics/flutter_acpanalytics.dart';
copied to clipboard
Getting the SDK version:
String version = await FlutterACPAnalytics.extensionVersion;
copied to clipboard
Registering the extension with ACPCore:

Note: It is required to initialize the SDK via native code inside your AppDelegate and MainApplication for iOS and Android respectively. For more information see how to initialize Core.

iOS

Swift

import ACPAnalytics

ACPAnalytics.registerExtension()
copied to clipboard

Objective-C

#import "ACPAnalytics.h"

[ACPAnalytics registerExtension];
copied to clipboard
Android:
import com.adobe.marketing.mobile.Analytics;

Analytics.registerExtension();
copied to clipboard
Get the tracking identifier:
String trackingId;

try {
trackingId = await FlutterACPAnalytics.trackingIdentifier;
} on PlatformException {
log("Failed to get the tracking identifier");
}
copied to clipboard
Send queued hits:
FlutterACPAnalytics.sendQueuedHits();
copied to clipboard
Get the queue size:
int queueSize;

try {
queueSize = await FlutterACPAnalytics.queueSize;
} on PlatformException {
log("Failed to get the queue size");
}
copied to clipboard
Clear queued hits:
FlutterACPAnalytics.clearQueue();
copied to clipboard
Set the custom visitor identifier:
FlutterACPAnalytics.setVisitorIdentifier("vid");
copied to clipboard
Get the custom visitor identifier:
String visitorId;

try {
visitorId = await FlutterACPAnalytics.visitorIdentifier;
} on PlatformException {
visitorId = "Failed to get the visitor identifier";
}
copied to clipboard
Track app actions:
FlutterACPCore.trackAction("myAction",  data: {"key1": "value1"});
copied to clipboard
Track app states:
FlutterACPCore.trackState("myState",  data: {"key1": "value1"});
copied to clipboard

Contributing #

See CONTRIBUTING

License #

See LICENSE

6
likes
140
points
720
downloads

Publisher

verified publisheradobe.com

Weekly Downloads

2024.10.05 - 2025.04.19

Official Adobe Experience Platform support for Flutter apps. The Analytics extension allows for integration with Adobe Analytics.

Homepage
Repository (GitHub)
Contributing

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter, flutter_acpcore

More

Packages that depend on flutter_acpanalytics