Package io.piano.analytics
Class PianoAnalytics
- java.lang.Object
-
- io.piano.analytics.PianoAnalytics
-
public final class PianoAnalytics extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfacePianoAnalytics.OnGetConfigurationListenerstatic interfacePianoAnalytics.OnGetModelListenerstatic interfacePianoAnalytics.OnGetPrivacyIdListenerstatic interfacePianoAnalytics.OnGetPrivacyModeListenerstatic interfacePianoAnalytics.OnGetUserListenerstatic interfacePianoAnalytics.OnWorkListenerInterface providing interaction possibilitiesstatic classPianoAnalytics.PrivacyStorageFeaturestatic classPianoAnalytics.PrivacyVisitorMode
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteOfflineStorage()delete offline data stored on devicevoiddeleteOfflineStorage(int remaining)delete offline data stored on device and keep only remaining daysvoiddeleteProperty(String key)Delete property from customer contextvoiddeleteUser()Delete uservoidgetConfiguration(Configuration.ConfigurationKey key, PianoAnalytics.OnGetConfigurationListener l)Get configurationstatic PianoAnalyticsgetInstance(Context ctx)Simple default getInstancestatic PianoAnalyticsgetInstance(Context ctx, String configFileLocation)Specific getInstancevoidgetModel(PianoAnalytics.OnGetModelListener l)Get all data in the modelvoidgetUser(PianoAnalytics.OnGetUserListener l)voidgetVisitorId(PianoAnalytics.OnGetPrivacyIdListener l)Get current visitor idvoidprivacyCreateMode(String mode, boolean consent)Create privacy contextvoidprivacyExcludeEvent(String eventName)add privacy visitor mode forbidden events namevoidprivacyExcludeEvent(String eventName, String[] privacyModes)add privacy visitor mode forbidden events namevoidprivacyExcludeEvents(String[] eventsName)add privacy visitor mode forbidden events namevoidprivacyExcludeEvents(String[] eventsName, String[] privacyModes)add privacy visitor mode forbidden events namevoidprivacyExcludeProperties(String[] properties)add privacy visitor mode forbidden properties on eventsvoidprivacyExcludeProperties(String[] properties, String[] privacyModes)add privacy visitor mode forbidden properties on eventsvoidprivacyExcludeProperties(String[] properties, String[] privacyModes, String[] eventNames)add privacy visitor mode forbidden properties on eventsvoidprivacyExcludeProperty(String property)add privacy visitor mode forbidden properties on eventsvoidprivacyExcludeProperty(String property, String[] privacyModes)add privacy visitor mode forbidden properties on eventsvoidprivacyExcludeProperty(String property, String[] privacyModes, String[] eventNames)add privacy visitor mode forbidden properties on eventsvoidprivacyExcludeStorageKey(PianoAnalytics.PrivacyStorageFeature storageKey)exclude privacy visitor mode storagevoidprivacyExcludeStorageKey(PianoAnalytics.PrivacyStorageFeature storageKey, String[] privacyModes)exclude privacy visitor mode storagevoidprivacyExcludeStorageKeys(PianoAnalytics.PrivacyStorageFeature[] storageKeys)exclude privacy visitor mode storagevoidprivacyExcludeStorageKeys(PianoAnalytics.PrivacyStorageFeature[] storageKeys, String[] privacyModes)exclude privacy visitor mode storagevoidprivacyGetMode(PianoAnalytics.OnGetPrivacyModeListener l)voidprivacyIncludeEvent(String eventName)add privacy visitor mode authorized events namevoidprivacyIncludeEvent(String eventName, String[] privacyModes)add privacy visitor mode authorized events namevoidprivacyIncludeEvents(String[] eventsName)add privacy visitor mode authorized events namevoidprivacyIncludeEvents(String[] eventsName, String[] privacyModes)add privacy visitor mode authorized events namevoidprivacyIncludeProperties(String[] properties)add privacy visitor mode authorized properties on eventsvoidprivacyIncludeProperties(String[] properties, String[] privacyModes)add privacy visitor mode authorized properties on eventsvoidprivacyIncludeProperties(String[] properties, String[] privacyVisitorModes, String[] eventNames)add privacy visitor mode authorized properties on eventsvoidprivacyIncludeProperty(String property)add privacy visitor mode authorized properties on eventsvoidprivacyIncludeProperty(String property, String[] privacyModes)add privacy visitor mode authorized properties on eventsvoidprivacyIncludeProperty(String property, String[] privacyModes, String[] eventNames)add privacy visitor mode authorized properties on eventsvoidprivacyIncludeStorageKey(PianoAnalytics.PrivacyStorageFeature storageKey)add privacy visitor mode storagevoidprivacyIncludeStorageKey(PianoAnalytics.PrivacyStorageFeature storageKey, String[] privacyModes)add privacy visitor mode storagevoidprivacyIncludeStorageKeys(PianoAnalytics.PrivacyStorageFeature[] storageKeys)add privacy visitor mode storagevoidprivacyIncludeStorageKeys(PianoAnalytics.PrivacyStorageFeature[] storageKeys, String[] privacyModes)add privacy visitor mode storagevoidprivacySetMode(String mode)Update privacy contextvoidsendEvent(Event event)Send event datavoidsendEvent(Event event, Configuration config)Send event datavoidsendEvent(Event event, Configuration config, PianoAnalytics.OnWorkListener l)Send event datavoidsendEvents(List<Event> events)Send events datavoidsendEvents(List<Event> events, Configuration config)Send events datavoidsendEvents(List<Event> events, Configuration config, PianoAnalytics.OnWorkListener l)Send events datavoidsendOfflineData()send offline data stored on devicevoidsendOfflineData(Configuration config)send offline data stored on devicevoidsendOfflineData(Configuration config, PianoAnalytics.OnWorkListener l)send offline data stored on devicevoidsetConfiguration(Configuration config)Update configurationvoidsetConfiguration(Configuration.ConfigurationKey key, String value)Update configurationvoidsetProperties(Map<String,Object> data)dictionary of properties to setvoidsetProperties(Map<String,Object> data, Boolean persistent)dictionary of properties to setvoidsetProperties(Map<String,Object> data, Boolean persistent, String[] events)dictionary of properties to setvoidsetProperty(String key, Object value)Update customer contextvoidsetProperty(String key, Object value, Boolean persistent)Update customer contextvoidsetProperty(String key, Object value, Boolean persistent, String[] events)Update customer contextvoidsetUser(String userId)Set uservoidsetUser(String userId, String userCategory)Set uservoidsetUser(String userId, String userCategory, boolean enableStorage)Set uservoidsetVisitorId(String visitorId)Set current visitor id
-
-
-
Method Detail
-
getInstance
public static PianoAnalytics getInstance(@NonNull Context ctx)
Simple default getInstance- Parameters:
ctx- activity context
-
getInstance
public static PianoAnalytics getInstance(@NonNull Context ctx, @NonNull String configFileLocation)
Specific getInstance- Parameters:
ctx- activity contextconfigFileLocation- file path from assets folder
-
sendEvent
public void sendEvent(@NonNull Event event)Send event data- Parameters:
event- a custom event
-
sendEvent
public void sendEvent(@NonNull Event event, Configuration config)Send event data- Parameters:
event- a custom eventconfig- custom config used only for this action
-
sendEvent
public void sendEvent(@NonNull Event event, Configuration config, PianoAnalytics.OnWorkListener l)Send event data- Parameters:
event- a custom eventconfig- custom config used only for this actionl- work listener to leave customer handling
-
sendEvents
public void sendEvents(@NonNull List<Event> events)Send events data- Parameters:
events- a custom event list
-
sendEvents
public void sendEvents(@NonNull List<Event> events, Configuration config)Send events data- Parameters:
events- a custom event listconfig- custom config used only for this action
-
sendEvents
public void sendEvents(@NonNull List<Event> events, Configuration config, PianoAnalytics.OnWorkListener l)Send events data- Parameters:
events- a custom event listconfig- custom config used only for this actionl- work listener to leave customer handling
-
getConfiguration
public void getConfiguration(Configuration.ConfigurationKey key, PianoAnalytics.OnGetConfigurationListener l)
Get configuration- Parameters:
key- configuration key to getl- work listener to leave customer handling
-
setConfiguration
public void setConfiguration(Configuration.ConfigurationKey key, String value)
Update configuration- Parameters:
key- configuration keyvalue- configuration value
-
setConfiguration
public void setConfiguration(@NonNull Configuration config)Update configuration- Parameters:
config- configuration object
-
setProperty
public void setProperty(String key, Object value)
Update customer context- Parameters:
key- property keyvalue- property value
-
setProperty
public void setProperty(String key, Object value, Boolean persistent)
Update customer context- Parameters:
key- property keyvalue- property valuepersistent- whether the property will be persistent or not
-
setProperty
public void setProperty(String key, Object value, Boolean persistent, String[] events)
Update customer context- Parameters:
key- property keyvalue- property valuepersistent- whether the property will be persistent or notevents- will send the property only those specific events
-
setProperties
public void setProperties(@NonNull Map<String,Object> data)dictionary of properties to set- Parameters:
data- property key
-
setProperties
public void setProperties(@NonNull Map<String,Object> data, Boolean persistent)dictionary of properties to set- Parameters:
data- property keypersistent- whether the property will be persistent or not
-
setProperties
public void setProperties(@NonNull Map<String,Object> data, Boolean persistent, String[] events)dictionary of properties to set- Parameters:
data- property keypersistent- whether the property will be persistent or notevents- will send the property only those specific events
-
deleteProperty
public void deleteProperty(@NonNull String key)Delete property from customer context- Parameters:
key- customer context property key
-
getUser
public void getUser(PianoAnalytics.OnGetUserListener l)
-
setUser
public void setUser(@NonNull String userId)Set user- Parameters:
userId- new user id
-
setUser
public void setUser(@NonNull String userId, String userCategory)Set user- Parameters:
userId- new user iduserCategory- new user category
-
setUser
public void setUser(@NonNull String userId, String userCategory, boolean enableStorage)Set user- Parameters:
userId- new user iduserCategory- new user categoryenableStorage- to store user in user defaults
-
deleteUser
public void deleteUser()
Delete user
-
privacyCreateMode
public void privacyCreateMode(@NonNull String mode, boolean consent)Create privacy context- Parameters:
mode- a new privacy visitor modeconsent- if user consented
-
privacySetMode
public void privacySetMode(@NonNull String mode)Update privacy context- Parameters:
mode- a privacy visitor mode
-
privacyGetMode
public void privacyGetMode(PianoAnalytics.OnGetPrivacyModeListener l)
-
privacyIncludeEvent
public void privacyIncludeEvent(String eventName)
add privacy visitor mode authorized events name- Parameters:
eventName- string of an event name appended with what is currently set
-
privacyIncludeEvent
public void privacyIncludeEvent(String eventName, String[] privacyModes)
add privacy visitor mode authorized events name- Parameters:
eventName- string of an event name appended with what is currently setprivacyModes- a privacy visitor mode
-
privacyIncludeEvents
public void privacyIncludeEvents(@NonNull String[] eventsName)add privacy visitor mode authorized events name- Parameters:
eventsName- string set of events name appended with currently set
-
privacyIncludeEvents
public void privacyIncludeEvents(@NonNull String[] eventsName, String[] privacyModes)add privacy visitor mode authorized events name- Parameters:
eventsName- string set of events name appended with currently setprivacyModes- a set of privacy visitor modes or by default applies to all modes
-
privacyExcludeEvent
public void privacyExcludeEvent(String eventName)
add privacy visitor mode forbidden events name- Parameters:
eventName- string of an event name appended with what is currently set
-
privacyExcludeEvent
public void privacyExcludeEvent(String eventName, String[] privacyModes)
add privacy visitor mode forbidden events name- Parameters:
eventName- string of an event name appended with what is currently setprivacyModes- a privacy visitor mode
-
privacyExcludeEvents
public void privacyExcludeEvents(@NonNull String[] eventsName)add privacy visitor mode forbidden events name- Parameters:
eventsName- string set of events name appended with currently set
-
privacyExcludeEvents
public void privacyExcludeEvents(@NonNull String[] eventsName, String[] privacyModes)add privacy visitor mode forbidden events name- Parameters:
eventsName- string set of events name appended with currently setprivacyModes- a privacy visitor mode
-
privacyIncludeProperty
public void privacyIncludeProperty(@NonNull String property)add privacy visitor mode authorized properties on events- Parameters:
property- string property appended with what is currently set
-
privacyIncludeProperty
public void privacyIncludeProperty(@NonNull String property, String[] privacyModes)add privacy visitor mode authorized properties on events- Parameters:
property- string property appended with what is currently setprivacyModes- array of privacy modes on which we will authorize the properties, by default we authorize the properties for all the privacy modes
-
privacyIncludeProperty
public void privacyIncludeProperty(@NonNull String property, String[] privacyModes, String[] eventNames)add privacy visitor mode authorized properties on events- Parameters:
property- string property appended with what is currently setprivacyModes- array of privacy modes on which we will authorize the properties, by default we authorize the properties for all the privacy modeseventNames- string property appended with what is currently set
-
privacyIncludeProperties
public void privacyIncludeProperties(@NonNull String[] properties)add privacy visitor mode authorized properties on events- Parameters:
properties- string array of properties to authorize
-
privacyIncludeProperties
public void privacyIncludeProperties(@NonNull String[] properties, String[] privacyModes)add privacy visitor mode authorized properties on events- Parameters:
properties- string array of properties to authorizeprivacyModes- string array of modes to apply authorization
-
privacyIncludeProperties
public void privacyIncludeProperties(@NonNull String[] properties, String[] privacyVisitorModes, String[] eventNames)add privacy visitor mode authorized properties on events- Parameters:
properties- string array of properties to authorizeprivacyVisitorModes- string array of modes to apply authorizationeventNames- string array of event names to apply authorization
-
privacyExcludeProperty
public void privacyExcludeProperty(@NonNull String property)add privacy visitor mode forbidden properties on events- Parameters:
property- string property appended with what is currently set
-
privacyExcludeProperty
public void privacyExcludeProperty(@NonNull String property, String[] privacyModes)add privacy visitor mode forbidden properties on events- Parameters:
property- string property appended with what is currently setprivacyModes- string array of modes to apply forbiddance
-
privacyExcludeProperty
public void privacyExcludeProperty(@NonNull String property, String[] privacyModes, String[] eventNames)add privacy visitor mode forbidden properties on events- Parameters:
property- string property appended with what is currently setprivacyModes- string array of modes to apply forbiddanceeventNames- string array of event names to apply forbiddance
-
privacyExcludeProperties
public void privacyExcludeProperties(@NonNull String[] properties)add privacy visitor mode forbidden properties on events- Parameters:
properties- string array of properties to forbid
-
privacyExcludeProperties
public void privacyExcludeProperties(@NonNull String[] properties, String[] privacyModes)add privacy visitor mode forbidden properties on events- Parameters:
properties- string array of properties to forbidprivacyModes- string array of modes to apply forbiddance
-
privacyExcludeProperties
public void privacyExcludeProperties(@NonNull String[] properties, String[] privacyModes, String[] eventNames)add privacy visitor mode forbidden properties on events- Parameters:
properties- string array of properties to forbidprivacyModes- string array of modes to apply forbiddanceeventNames- string array of event names to apply forbiddance
-
privacyIncludeStorageKey
public void privacyIncludeStorageKey(@NonNull PianoAnalytics.PrivacyStorageFeature storageKey)add privacy visitor mode storage- Parameters:
storageKey- string of authorized key to store data into device
-
privacyIncludeStorageKey
public void privacyIncludeStorageKey(@NonNull PianoAnalytics.PrivacyStorageFeature storageKey, String[] privacyModes)add privacy visitor mode storage- Parameters:
storageKey- string of authorized key to store data into deviceprivacyModes- an array of privacy visitor modes on which to include these keys
-
privacyIncludeStorageKeys
public void privacyIncludeStorageKeys(@NonNull PianoAnalytics.PrivacyStorageFeature[] storageKeys)add privacy visitor mode storage- Parameters:
storageKeys- PrivacyStorageFeature set of authorized features to store data into device
-
privacyIncludeStorageKeys
public void privacyIncludeStorageKeys(@NonNull PianoAnalytics.PrivacyStorageFeature[] storageKeys, String[] privacyModes)add privacy visitor mode storage- Parameters:
storageKeys- PrivacyStorageFeature set of authorized features to store data into deviceprivacyModes- an array of privacy visitor modes on which to include these keys
-
privacyExcludeStorageKey
public void privacyExcludeStorageKey(@NonNull PianoAnalytics.PrivacyStorageFeature storageKey)exclude privacy visitor mode storage- Parameters:
storageKey- string of forbidden key to store data into device
-
privacyExcludeStorageKey
public void privacyExcludeStorageKey(@NonNull PianoAnalytics.PrivacyStorageFeature storageKey, String[] privacyModes)exclude privacy visitor mode storage- Parameters:
storageKey- string of forbidden key to store data into deviceprivacyModes- an array of privacy visitor modes on which to include these keys
-
privacyExcludeStorageKeys
public void privacyExcludeStorageKeys(@NonNull PianoAnalytics.PrivacyStorageFeature[] storageKeys)exclude privacy visitor mode storage- Parameters:
storageKeys- PrivacyStorageFeature set of forbidden features to store data into device
-
privacyExcludeStorageKeys
public void privacyExcludeStorageKeys(@NonNull PianoAnalytics.PrivacyStorageFeature[] storageKeys, String[] privacyModes)exclude privacy visitor mode storage- Parameters:
storageKeys- PrivacyStorageFeature set of forbidden features to store data into deviceprivacyModes- an array of privacy visitor modes on which to include these keys
-
sendOfflineData
public void sendOfflineData()
send offline data stored on device
-
sendOfflineData
public void sendOfflineData(Configuration config)
send offline data stored on device- Parameters:
config- custom config used only for this action
-
sendOfflineData
public void sendOfflineData(Configuration config, PianoAnalytics.OnWorkListener l)
send offline data stored on device- Parameters:
config- custom config used only for this actionl- work listener to leave customer handling
-
deleteOfflineStorage
public void deleteOfflineStorage()
delete offline data stored on device
-
deleteOfflineStorage
public void deleteOfflineStorage(int remaining)
delete offline data stored on device and keep only remaining days- Parameters:
remaining- age of data which have to be kept (in days)
-
getVisitorId
public void getVisitorId(PianoAnalytics.OnGetPrivacyIdListener l)
Get current visitor id- Parameters:
l- work listener to leave customer handling
-
setVisitorId
public void setVisitorId(String visitorId)
Set current visitor id- Parameters:
visitorId- custom visitor id to force in upcoming events
-
getModel
public void getModel(@NonNull PianoAnalytics.OnGetModelListener l)Get all data in the model- Parameters:
l- listener which have to be implemented to get data
-
-