public class DataCollectorManager extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DataCollectorManager.Gender |
static class |
DataCollectorManager.MetricType |
static class |
DataCollectorManager.ValueType |
Modifier and Type | Method and Description |
---|---|
void |
addProductToCart(PurchaseProduct product)
This function sends metric to PUSHTech platform
when the user add product to cart.
|
void |
addProductToCart(PurchaseProduct product,
DataCollectorManager.MetricType type)
This function sends metric to PUSHTech platform
when the user add product to cart.
|
void |
contentView(String nameOfView)
This function sends a name of current content view the user visualized.
|
void |
contentView(String nameOfView,
DataCollectorManager.MetricType type)
This function sends a name of current content view the user visualized.
|
static DataCollectorManager |
getInstance(Context ctx) |
void |
loginFacebook()
This function sends metric to PUSHTech platform when the user login in facebook.
|
void |
loginGeneric()
This function sends metric to PUSHTech platform when the user login in the app
|
void |
loginGoogle()
This function sends metric to PUSHTech platform when the user login in Google.
|
void |
loginTwitter()
This function sends metric to PUSHTech platform when the user login in Twitter.
|
void |
logoutFacebook()
This function sends metric to PUSHTech platform when the user logout in facebook.
|
void |
logoutGeneric()
This function sends metric to PUSHTech platform when the user logout in the app.
|
void |
logoutGoogle()
This function sends metric to PUSHTech platform when the user logout in Google.
|
void |
logoutTwitter()
This function sends metric to PUSHTech platform when the user logout in Twitter.
|
void |
purchaseProduct(Products products)
This function sends metric to PUSHTech platform
when the user purchase any product.
|
void |
purchaseProduct(Products products,
DataCollectorManager.MetricType type)
This function sends metric to PUSHTech platform
when the user purchase any product.
|
void |
registerGeneric()
This function sends metric to PUSHTech platform when the user create an account in this app.
|
void |
removeProductFromCart(PurchaseProduct product)
This function sends metric to PUSHTech platform
when the user remove product from cart.
|
void |
removeProductFromCart(PurchaseProduct product,
DataCollectorManager.MetricType type)
This function sends metric to PUSHTech platform
when the user remove product from cart.
|
void |
sendGeolocation()
This function sends user's geolocation to PUSHTech platform
|
void |
sendGeolocation(DataCollectorManager.MetricType type)
This function sends user's geolocation to PUSHTech platform.
|
void |
sendGeolocation(Location location,
DataCollectorManager.MetricType type)
This function sends custom geolocation to PUSHTech platform.
|
void |
sendMetrics() |
void |
setBirthdate(Date date)
This function sends user's birthdate to PUSHTech platform.
|
void |
setBirthdate(Date date,
DataCollectorManager.MetricType type)
This function sends user's birthdate to PUSHTech platform.
|
void |
setCity(String city)
This function sends user's city to PUSHTech platform.
|
void |
setCity(String city,
DataCollectorManager.MetricType type)
This function sends user's city to PUSHTech platform.
|
void |
setCountry(Country country)
This function sends user's country to PUSHTech platform.
|
void |
setCountry(Country country,
DataCollectorManager.MetricType type)
This function sends user's country to PUSHTech platform.
|
void |
setCustomEvent(DataCollectorManager.MetricType metricType,
String type,
String eventType,
String value,
DataCollectorManager.ValueType valueType)
This function sends custom metric to PUSHTech platform.
|
void |
setCustomEvent(String type,
String eventType,
String value,
DataCollectorManager.ValueType valueType)
This function sends custom metric to PUSHTech platform.
|
void |
setEmail(String email)
This function sends user's email to PUSHTech platform.
|
void |
setEmail(String email,
DataCollectorManager.MetricType type)
This function sends user's email to PUSHTech platform.
|
void |
setFacebookID(String id)
This function sends metric user's facebook id to PUSHTech.
|
void |
setFacebookID(String id,
DataCollectorManager.MetricType type)
This function sends metric user's facebook id to PUSHTech.
|
void |
setFirstName(String firstName)
This function sends user's name to PUSHTech platform.
|
void |
setFirstName(String firstName,
DataCollectorManager.MetricType type)
This function sends user's name to PUSHTech platform.
|
void |
setGender(DataCollectorManager.Gender gender)
This function sends user's gender to PUSHTech platform.
|
void |
setGender(DataCollectorManager.Gender gender,
DataCollectorManager.MetricType type)
This function sends user's gender to PUSHTech platform.
|
void |
setGoogleID(String id)
This function sends metric user's Google id to PUSHTech.
|
void |
setGoogleID(String id,
DataCollectorManager.MetricType type)
This function sends metric user's Google id to PUSHTech.
|
void |
setLastName(String lastName)
This function sends user's last name to PUSHTech platform.
|
void |
setLastName(String lastName,
DataCollectorManager.MetricType type)
This function sends user's last name to PUSHTech platform.
|
void |
setNumberFacebookFriends(int num)
This function sends number of friends in facebook to PUSHTech platform.
|
void |
setNumberFacebookFriends(int num,
DataCollectorManager.MetricType type)
This function sends number of friends in facebook to PUSHTech platform.
|
void |
setNumberOfTwitterFollowers(int num)
This function sends number of twitter followers to PUSHTech platform.
|
void |
setNumberOfTwitterFollowers(int num,
DataCollectorManager.MetricType type)
This function sends number of twitter followers to PUSHTech platform.
|
void |
setNumOfProductInCart(int num)
This function sends number of products in cart to PUSHTech platform
when the user update cart.
|
void |
setNumOfProductInCart(int num,
DataCollectorManager.MetricType type)
This function sends number of products in cart to PUSHTech platform
when the user update cart.
|
void |
setOpenPushCampaign(String campaignId)
This function sends metric to PUSHTech platform
when the user open a pushCampaign.
|
void |
setPhoneNumber(Phonenumber.PhoneNumber phoneNumber)
This function sends user's phoneNumber to PUSHTech platform.
|
void |
setPhoneNumber(Phonenumber.PhoneNumber phoneNumber,
DataCollectorManager.MetricType type)
This function sends user's phoneNumber to PUSHTech platform.
|
void |
setReceivedPushCampaign(String campaignId)
This function sends metric to PUSHTech platform
when the user received a pushCampaign.
|
void |
setTwitterID(String id)
This function sends metric user's Twitter id to PUSHTech.
|
void |
setTwitterID(String id,
DataCollectorManager.MetricType type)
This function sends metric user's Twitter id to PUSHTech.
|
void |
setUserId(String id)
This function sends metric user's id to PUSHTech.
|
void |
setUserId(String id,
DataCollectorManager.MetricType type)
This function sends metric user's id to PUSHTech.
|
void |
subscribePushNotifications()
This function sends metric to PUSHTech platform
when the user decided to received more push notifications
|
void |
unsubscribePushNotifications()
This function sends metric to PUSHTech platform
when the user decided to NO received more push notifications
|
public static DataCollectorManager getInstance(Context ctx)
public void sendMetrics()
public void setBirthdate(Date date)
date
- user's birthdate.public void setBirthdate(Date date, DataCollectorManager.MetricType type)
date
- user's birthdate.type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void sendGeolocation()
public void sendGeolocation(DataCollectorManager.MetricType type)
type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void sendGeolocation(Location location, DataCollectorManager.MetricType type)
location
- The location that send.type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void setCountry(Country country)
country
- user's country.public void setCountry(Country country, DataCollectorManager.MetricType type)
country
- user's country.type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void setCity(String city)
city
- user's city.public void setCity(String city, DataCollectorManager.MetricType type)
city
- user's city.type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void setFirstName(String firstName)
firstName
- user's name.public void setFirstName(String firstName, DataCollectorManager.MetricType type)
firstName
- user's name.type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void setLastName(String lastName)
lastName
- user's lastName.public void setLastName(String lastName, DataCollectorManager.MetricType type)
lastName
- user's lastName.type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void setGender(DataCollectorManager.Gender gender)
gender
- user's gender.public void setGender(DataCollectorManager.Gender gender, DataCollectorManager.MetricType type)
gender
- user's gender.type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void setEmail(String email)
email
- user's email.public void setEmail(String email, DataCollectorManager.MetricType type)
email
- user's email.type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void setPhoneNumber(Phonenumber.PhoneNumber phoneNumber)
phoneNumber
- user's phone number.public void setPhoneNumber(Phonenumber.PhoneNumber phoneNumber, DataCollectorManager.MetricType type)
phoneNumber
- user's phone number.type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void loginGeneric()
public void logoutGeneric()
public void registerGeneric()
public void setUserId(String id)
id
- The unique id to identify this users in your app.public void setUserId(String id, DataCollectorManager.MetricType type)
id
- The unique id to identify this users in your app.type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void loginFacebook()
public void logoutFacebook()
public void setFacebookID(String id)
id
- User's facebook id.public void setFacebookID(String id, DataCollectorManager.MetricType type)
id
- User's facebook id.type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void loginTwitter()
public void logoutTwitter()
public void setTwitterID(String id)
id
- User's Twitter id.public void setTwitterID(String id, DataCollectorManager.MetricType type)
id
- User's Twitter id.type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void loginGoogle()
public void logoutGoogle()
public void setGoogleID(String id)
id
- User's Google id.public void setGoogleID(String id, DataCollectorManager.MetricType type)
id
- User's Google id.type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void setNumberFacebookFriends(int num)
num
- The number of facebook friends.public void setNumberFacebookFriends(int num, DataCollectorManager.MetricType type)
num
- The number of facebook friends.type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void setNumberOfTwitterFollowers(int num)
num
- The number of followers.public void setNumberOfTwitterFollowers(int num, DataCollectorManager.MetricType type)
num
- The number of followers.type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void contentView(String nameOfView)
nameOfView
- The name of content view.public void contentView(String nameOfView, DataCollectorManager.MetricType type)
nameOfView
- The name of content view.type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void purchaseProduct(Products products)
products
- A list of productspublic void purchaseProduct(Products products, DataCollectorManager.MetricType type)
products
- A list of productstype
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void addProductToCart(PurchaseProduct product)
product
- product that add to cartpublic void addProductToCart(PurchaseProduct product, DataCollectorManager.MetricType type)
product
- product that add to carttype
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void setNumOfProductInCart(int num)
num
- Num of products in cart.public void setNumOfProductInCart(int num, DataCollectorManager.MetricType type)
num
- Num of products in cart.type
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void removeProductFromCart(PurchaseProduct product)
product
- product that remove from cartpublic void removeProductFromCart(PurchaseProduct product, DataCollectorManager.MetricType type)
product
- product that remove from carttype
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.public void setReceivedPushCampaign(String campaignId)
campaignId
- the id of campaign extract in BackendDelivery
or CampaignDelivery
public void setOpenPushCampaign(String campaignId)
campaignId
- the id of campaign extract in BackendDelivery
or CampaignDelivery
public void unsubscribePushNotifications()
public void subscribePushNotifications()
public void setCustomEvent(String type, String eventType, String value, DataCollectorManager.ValueType valueType)
type
- a custom type.eventType
- a custom subtype.value
- a custom value.public void setCustomEvent(DataCollectorManager.MetricType metricType, String type, String eventType, String value, DataCollectorManager.ValueType valueType)
type
- a custom type.eventType
- a custom subtype.value
- a custom value.metricType
- If the type is FIX only send this metric when changed it,else type is VOLATAILE send everytime.