public class BranchEvent
extends java.lang.Object
Class for creating Branch events for tracking and analytical purpose.
This class represent a standard or custom BranchEvents. Standard Branch events are defined with BRANCH_STANDARD_EVENT.
Please use #logEvent() method to log the events for tracking.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ADD_TO_CART
Deprecated.
Please use #BranchEvent(BRANCH_STANDARD_EVENT) instead
|
static java.lang.String |
ADD_TO_WISH_LIST
Deprecated.
Please use #BranchEvent(BRANCH_STANDARD_EVENT) instead
|
static java.lang.String |
CANONICAL_ID_LIST
Deprecated.
Please use #BranchEvent(BRANCH_STANDARD_EVENT) instead
|
static java.lang.String |
PURCHASE_STARTED
Deprecated.
Please use #BranchEvent(BRANCH_STANDARD_EVENT) instead
|
static java.lang.String |
PURCHASED
Deprecated.
Please use #BranchEvent(BRANCH_STANDARD_EVENT) instead
|
static java.lang.String |
SHARE_COMPLETED
Deprecated.
Please use #BranchEvent(BRANCH_STANDARD_EVENT) instead
|
static java.lang.String |
SHARE_STARTED
Deprecated.
Please use #BranchEvent(BRANCH_STANDARD_EVENT) instead
|
static java.lang.String |
VIEW
Deprecated.
Please use #BranchEvent(BRANCH_STANDARD_EVENT) instead
|
| Constructor and Description |
|---|
BranchEvent(BRANCH_STANDARD_EVENT branchStandardEvent) |
BranchEvent(java.lang.String eventName) |
| Modifier and Type | Method and Description |
|---|---|
BranchEvent |
addContentItems(BranchUniversalObject... contentItems)
Use this method to add any
BranchUniversalObject associated with this event. |
BranchEvent |
addContentItems(java.util.List<BranchUniversalObject> contentItems)
Use this method to add any
BranchUniversalObject associated with this event. |
BranchEvent |
addCustomDataProperty(java.lang.String propertyName,
java.lang.String propertyValue)
Adds a custom data property associated with this Branch Event
|
boolean |
logEvent(android.content.Context context)
Logs this BranchEvent to Branch for tracking and analytics
|
BranchEvent |
setAffiliation(java.lang.String affiliation)
Set any affiliation for this transaction event
|
BranchEvent |
setCoupon(java.lang.String coupon)
Set any coupons associated with this transaction event
|
BranchEvent |
setCurrency(CurrencyType currency)
Set the currency related with this transaction event
|
BranchEvent |
setDescription(java.lang.String description)
Set description for this transaction event
|
BranchEvent |
setRevenue(double revenue)
Set the revenue value related with this transaction event
|
BranchEvent |
setSearchQuery(java.lang.String searchQuery)
Set any search query associated with the event
|
BranchEvent |
setShipping(double shipping)
Set the shipping value related with this transaction event
|
BranchEvent |
setTax(double tax)
Set the tax value related with this transaction event
|
BranchEvent |
setTransactionID(java.lang.String transactionID)
Set the transaction id associated with this event if there in any
|
public static final java.lang.String VIEW
public static final java.lang.String ADD_TO_WISH_LIST
public static final java.lang.String ADD_TO_CART
public static final java.lang.String PURCHASE_STARTED
public static final java.lang.String PURCHASED
public static final java.lang.String SHARE_STARTED
public static final java.lang.String SHARE_COMPLETED
public static final java.lang.String CANONICAL_ID_LIST
public BranchEvent(BRANCH_STANDARD_EVENT branchStandardEvent)
public BranchEvent(java.lang.String eventName)
public BranchEvent setTransactionID(java.lang.String transactionID)
transactionID - transactionIDpublic BranchEvent setCurrency(CurrencyType currency)
currency - iso4217Code for currency. Defined in CurrencyTypepublic BranchEvent setRevenue(double revenue)
revenue - double revenue valuepublic BranchEvent setShipping(double shipping)
shipping - double shipping valuepublic BranchEvent setTax(double tax)
tax - double tax valuepublic BranchEvent setCoupon(java.lang.String coupon)
coupon - String with any coupon valuepublic BranchEvent setAffiliation(java.lang.String affiliation)
affiliation - String any affiliation valuepublic BranchEvent setDescription(java.lang.String description)
description - String transaction descriptionpublic BranchEvent setSearchQuery(java.lang.String searchQuery)
searchQuery - String Search Query valuepublic BranchEvent addCustomDataProperty(java.lang.String propertyName, java.lang.String propertyValue)
propertyName - String Name of the custom propertypropertyValue - String Value of the custom propertypublic BranchEvent addContentItems(BranchUniversalObject... contentItems)
BranchUniversalObject associated with this event.contentItems - BranchUniversalObjects associated with this eventBRANCH_STANDARD_EVENT. BranchUniversalObjects will be ignored otherwisepublic BranchEvent addContentItems(java.util.List<BranchUniversalObject> contentItems)
BranchUniversalObject associated with this event.contentItems - A list of BranchUniversalObjects associated with this eventBRANCH_STANDARD_EVENT. BranchUniversalObjects will be ignored otherwisepublic boolean logEvent(android.content.Context context)
context - Current contexttrue if the event is logged to Branch