public class Event
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
adid
(Android) Google Play Services advertising ID
|
java.lang.String |
androidId
(Android) Android ID (not the advertising ID)
|
java.lang.String |
appVersion
The current version of your application.
|
protected AmplitudeCallbacks |
callback
Callback for Event
|
java.lang.String |
carrier
The carrier that the user is using.
|
java.lang.String |
city
The current city of the user.
|
java.lang.String |
country
The current country of the user.
|
java.lang.String |
deviceBrand
The device brand that the user is using.
|
java.lang.String |
deviceId
A device-specific identifier, such as the Identifier for Vendor on iOS.
|
java.lang.String |
deviceManufacturer
The device manufacturer that the user is using.
|
java.lang.String |
deviceModel
The device model that the user is using.
|
java.lang.String |
dma
The current Designated Market Area of the user.
|
int |
eventId
An incrementing counter to distinguish events with the same user_id and timestamp from each
other.
|
org.json.JSONObject |
eventProperties
A dictionary of key-value pairs that represent additional data to be sent along with the event.
|
java.lang.String |
eventType
A unique identifier for your event.
|
org.json.JSONObject |
groupProperties
This feature is only available to Enterprise customers who have purchased the Accounts add-on.
|
org.json.JSONObject |
groups
This feature is only available to Enterprise customers who have purchased the Accounts add-on.
|
java.lang.String |
idfa
(iOS) Identifier for Advertiser.
|
java.lang.String |
idfv
(iOS) Identifier for Vendor.
|
IngestionMetadata |
ingestionMetadata
The ingestion metadata.
|
java.lang.String |
insertId
A unique identifier for the event.
|
java.lang.String |
ip
The IP address of the user.
|
java.lang.String |
language
The (human) language set by the user.
|
double |
locationLat
The current Latitude of the user.
|
double |
locationLng
The current Longitude of the user.
|
java.lang.String |
osName
The name of the mobile operating system or browser that the user is using.
|
java.lang.String |
osVersion
The version of the mobile operating system or browser the user is using.
|
java.lang.String |
partnerId
The partner id of event
|
Plan |
plan
The tracking plan.
|
java.lang.String |
platform
Platform of the device.
|
java.lang.Double |
price
The price of the item purchased.
|
java.lang.String |
productId
An identifier for the item purchased.
|
int |
quantity
The quantity of the item purchased.
|
java.lang.String |
region
The current region of the user.
|
java.lang.Double |
revenue
revenue = price * quantity.
|
java.lang.String |
revenueType
The type of revenue for the item purchased.
|
long |
sessionId
The start time of the session in milliseconds since epoch (Unix Timestamp), necessary if you
want to associate events with a particular system.
|
long |
timestamp
The timestamp of the event in milliseconds since epoch.
|
java.lang.String |
userId
A readable ID specified by you.
|
org.json.JSONObject |
userProperties
A dictionary of key-value pairs that represent additional data tied to the user.
|
java.lang.String |
versionName
Legacy SDK API, only for use with older API.
|
| Constructor and Description |
|---|
Event(java.lang.String eventType,
java.lang.String userId)
Create a new event with the required items.
|
Event(java.lang.String eventType,
java.lang.String userId,
java.lang.String deviceId)
Create a new event with the required items.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
replaceWithJSONNull(java.lang.Object obj)
internal method
|
org.json.JSONObject |
toJsonObject() |
java.lang.String |
toString() |
protected org.json.JSONArray |
truncate(org.json.JSONArray array) |
protected org.json.JSONObject |
truncate(org.json.JSONObject object) |
protected java.lang.String |
truncate(java.lang.String value) |
public java.lang.String eventType
public java.lang.String userId
public java.lang.String deviceId
public long timestamp
public double locationLat
public double locationLng
public java.lang.String appVersion
public java.lang.String versionName
public java.lang.String platform
public java.lang.String osName
public java.lang.String osVersion
public java.lang.String deviceBrand
public java.lang.String deviceManufacturer
public java.lang.String deviceModel
public java.lang.String carrier
public java.lang.String country
public java.lang.String region
public java.lang.String city
public java.lang.String dma
public java.lang.String idfa
public java.lang.String idfv
public java.lang.String adid
public java.lang.String androidId
public java.lang.String language
public java.lang.String partnerId
public java.lang.String ip
public org.json.JSONObject eventProperties
public org.json.JSONObject userProperties
public java.lang.Double price
public int quantity
public java.lang.Double revenue
public java.lang.String productId
public java.lang.String revenueType
public int eventId
public long sessionId
public java.lang.String insertId
public org.json.JSONObject groups
public org.json.JSONObject groupProperties
public Plan plan
public IngestionMetadata ingestionMetadata
protected AmplitudeCallbacks callback
public Event(java.lang.String eventType,
java.lang.String userId)
eventType - A unique identifier for your eventuserId - A readable ID specified by you. Must have a minimum length of 5 characters.
Required unless device_id is present.public Event(java.lang.String eventType,
java.lang.String userId,
java.lang.String deviceId)
eventType - A unique identifier for your eventuserId - A readable ID specified by you. Must have a minimum length of 5 characters.
Required unless device_id is present.deviceId - A device-specific identifier, such as the Identifier for Vendor on iOS.
Required unless user_id is present. If a device_id is not sent with the event, it will be
set to a hashed version of the user_id.public org.json.JSONObject toJsonObject()
protected java.lang.Object replaceWithJSONNull(java.lang.Object obj)
protected org.json.JSONObject truncate(org.json.JSONObject object)
protected org.json.JSONArray truncate(org.json.JSONArray array)
throws org.json.JSONException
org.json.JSONExceptionpublic java.lang.String toString()
toString in class java.lang.Objectprotected java.lang.String truncate(java.lang.String value)