Amplitude class

Constructors

Amplitude(String instanceName)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearUserProperties() Future<void>
Clears all properties that are tracked on the user level.
disableCoppaControl() Future<void>
Disable COPPA (Children's Online Privacy Protection Act) restrictions on IDFA, IDFV, city, IP address and location tracking.
enableCoppaControl() Future<void>
Enable COPPA (Children's Online Privacy Protection Act) restrictions on IDFA, IDFV, city, IP address and location tracking.
getDeviceId() Future<String?>
Fetches the deviceId, a unique identifier shared between multiple users using the same app on the same device. @returns the deviceId.
getSessionId() Future<int?>
Fetches the current sessionId, an identifier used by Amplitude to group together events tracked during the same session. @returns the sessionId.
getUserId() Future<String?>
Fetches the userId, a unique identifier for tracking a user. @returns the userId
groupIdentify(String groupType, String groupName, Identify groupIdentify, {bool outOfSession = false}) Future<void>
Use the Group Identify API to set or update properties of particular groups. However, these updates will only affect events going forward.
identify(Identify identify) Future<void>
Update user properties using operations provided via Identify API.
init(String apiKey, {String? userId}) Future<void>
logEvent(String eventType, {Map<String, dynamic>? eventProperties, bool? outOfSession}) Future<void>
Tracks an event. Events are saved locally.
logRevenue(String productIdentifier, int quantity, double price) Future<void>
Tracks revenue. This allows us to automatically display data relevant to revenue on the Amplitude website, including average revenue per daily active user (ARPDAU), 7, 30, and 90 day revenue, lifetime value (LTV) estimates, and revenue by advertising campaign cohort and daily/weekly/monthly cohorts.
logRevenueAmount(double amount) Future<void>
Tracks revenue. This allows us to automatically display data relevant to revenue on the Amplitude website, including average revenue per daily active user (ARPDAU), 7, 30, and 90 day revenue, lifetime value (LTV) estimates, and revenue by advertising campaign cohort and daily/weekly/monthly cohorts.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
regenerateDeviceId() Future<void>
Regenerates a new random deviceId for current user. Note: this is not recommended unless you know what you are doing. This can be used in conjunction with setUserId(null) to anonymize users after they log out. With a null userId and a completely new deviceId, the current user would appear as a brand new user in dashboard.
setDeviceId(String deviceId) Future<void>
setEventUploadPeriodMillis(int value) Future<void>
setEventUploadThreshold(int value) Future<void>
setGroup(String groupType, dynamic groupName) Future<void>
Adds a user to a group or groups. You need to specify a groupType and groupName(s). For example you can group people by their organization. In this case, groupType is "orgId", and groupName would be the actual ID(s). groupName can be a string or an array of strings to indicate a user in multiple groups. You can also call setGroup multiple times with different groupTypes to track multiple types of groups (up to 5 per app). Note: This will also set groupType: groupName as a user property.
setMinTimeBetweenSessionsMillis(int timeInMillis) Future<void>
Defines a custom session expiration time where the timeout input is in milliseconds.
setOffline(bool enabled) Future<void>
Sets offline. If offline is true, then the SDK will not upload events to Amplitude servers; however, it will still log events.
setOptOut(bool optOut) Future<void>
Enables tracking opt out.
setServerUrl(String serverUrl) Future<void>
Customize the destination for server url.
setServerZone(String serverZone, {bool updateServerUrl = true}) Future<void>
Set Amplitude Server Zone, switch to zone related configuration, including dynamic configuration and server url. To send data to Amplitude's EU servers, you need to configure the serverZone to EU like client.setServerZone("EU"); serverZone could be EU or US. Recommend to keep updateServerUrl to be true for alignment.
setUseDynamicConfig(bool useDynamicConfig) Future<void>
Dynamically adjust server URL
setUserId(String? userId, {bool? startNewSession}) Future<void>
If your app has its own login system that you want to track users with, you can set the userId.
setUserProperties(Map<String, dynamic> userProperties) Future<void>
Adds properties that are tracked on the user level.
toString() String
A string representation of this object.
inherited
trackingSessionEvents(bool trackingSessionEvents) Future<void>
Whether to automatically log start and end session events corresponding to the start and end of a user's session.
uploadEvents() Future<void>
Upload all unsent events.
useAppSetIdForDeviceId() Future<void>

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

getInstance({String instanceName = '\$default_instance'}) Amplitude