- Print
- DarkLight
- PDF
WTDataCollector Class Reference
Public Member Functions
WTDataCollector is the central class provided by WebtrendsSDK. Its central purpose is to log and send events to the Webtrends collection servers. It's primarily accessed through its sharedCollector singleton. It should not be manually initialized.
appendSessionParamsToUrl
appendSessionParamsToUrl ( final String url)
A helper method to append the WT session parameters to the URL of the embedded web content. These parameters are parsed by the JavaScript plug-in in the embedded content and used to configure its user ID and session configuration. This method is not necessary when using the openUrl() method, which appends session parameters itself.
Parameters
url
The String destination URL that the WebView will open. Session parameters will be appended to the URL in a query string.
Returns
String
- the String URL with session parameters appended.
appendSessionParamsToUrl
appendSessionParamsToUrl ( final String url )
Parameters
url
Returns
String
enableWtInWebView
enableWtInWebView ( final WebView webview )
Sets the specified webView's client (delegate) to the Webtrends class WTWebViewClient. This enables communication of session data between the webView and the Webtrends SDK.
Parameters
webview
The webView used in the hybrid application
getConfigValue
getConfigValue ( final String key )
Look up a config value from the Webtrends config. This method will block the current thread until the value is returned, though the config is stored locally and would not be expected to delay the thread long enough to trigger an error.
Parameters
key
Specifies the String key to look up the value of
Returns
String
- The string representation of the stored config value.
getConfigValueAsync
getConfigValueAsync ( final String key )
Look up a config value from the Webtrends config asynchronously. This method does not block the current thread.
Parameters
key
Specifies the key for which value to look up
Returns
a Future<String> representation of the stored config value.
getEventStoreSize
getEventStoreSize ( )
Get the current event count, the number of events queued and ready to send to the data collection server.
Returns
int
- The number of events in the local data store
getInstance
WTDataCollector getInstance ( )
Get the WTDataCollector singleton.
Returns
static
- The WTDataCollector singleton instance
Example:
// Get an instance of the WTDataCollector and assign it to a variable:
WTDataCollector collector = WTDataCollector.getInstance();
onActivityEnd
onActivityEnd(final String activityName,
final Map< String, String > customData
)
Generate an Activity End event (Automatically generated when automatic events are enabled)
When calling this method manually, it is recommended to place the call in the activity lifecycle such as in the Activity.onStop()
method.
Parameters
activityName
Specifies an activity name associated with this event.
customData
Specifies a series of custom name-value parameters used to pass data that is not included in the method.
Returns
Map<String, String>
- The collection of key/value pairs that make up the event (as a Map<String, String>). This may be discarded.
Example:
@Override
public void onStop() {
// Create some custom data, but this is optional:
Map<String, String> customData = new HashMap<String, String>();
customData.put("foo", "bar");
customData.put("boo", "baz");
// Create the application start event.
WTDataCollector.getInstance().onActivityEnd("My Activity", customData);
super.onTerminate();
}
Webtrends parameters included in this event:
dcsuri
: "/activity/end"WT.ti
: activityNameWT.pi
: activityNameWT.dl
: "61"WT.sys
: "end"
In addition to these, all events contain the following Webtrends params:
WT.ets
: Epoch Time Stamp, set at event creation timeWT.co
: Set Cookie on Redirect, always "yes"WT.dm
: Device Model, set by accessing \c android.os.Build.model and \c BUILD.manufacturer properties or "unknown"WT.os
: Operating System Version, reported by android.os.Build.VERSION.RELEASE or "unknown"WT.av
: Application Version, set by the wt_dc_app_version config setting or context.getPackageName()WT.a_nm
: Application Name, set by the wt_dc_app_name config setting or context.getApplicationInfo().labelResWT.a_dc
: Data Carrier, set by Context.TELEPHONY_SERVICEWT.ul
: Locale Language, set by Locale.getDefault().getDisplayLanguage()WT.uc
: Locale Country, set by Locale.getDefault().getDisplayCountry()WT.sr
: Screen Resolution, set by context.getSystemService(Context.WINDOW_SERVICE).getDefaultDisplay().getMetrics()WT.sdk_v
: SDK Version, set by BuildConfig.VERSION_NAMEWT.ct
: Connection Type,set by the CONNECTIVITY_SERVICE getActiveNetworkInfo()WT.g_co
: Country Code, set by the TELEPHONY_SERVICE getNetworkCountryIso()WT.d_id
: Unique ID, set by randomly generated ID(only included if the wt_dc_send_unique_id_enabled : config setting is set to true)WT.i_ornt
: Interface Orientation, set by the Display.getOrientation() method
Session Parameters
WT.vtvs
: Session Start, the start time of the current sessionWT.co_f
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_sid
: VisitorID.SessionStart, a concatenation of WT.co_f and WT.vtvs, joined with a "."WT.vtid
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_f
: First hit ever for this visitor, "1" if true, "0" if falseWT.vt_f_s
: First hit of the session for this visitor, "1" if true, "0" if falseWT.vt_f_d
: First hit of the day for this visitor, "1" if true, "0" if falseWT.vt_f_tlh
: Time of last hit
This method is called automatically when automatics are turned on (setting wt_dc_automatics_enabled = true). Automatic methods will be called without any custom params.
onActivityPause
onActivityPause(final String activityName,
final Map< String, String > customData
)
Generate an Activity Pause event (Automatically generated when automatic events are enabled)
When calling this method manually, it is recommended to place the call in the activity lifecycle such as in the Activity.onPause()
method.
Parameters
activityName
Specifies an activity name associated with this event.
customData
Specifies a series of custom name-value parameters used to pass data that is not included in the method.
Returns
Map<String, String>
- The collection of key/value pairs that make up the event (as a Map<String, String>). This may be discarded.
Example:
@Override
public void onPause() {
// Create some custom data, but this is optional:
Map<String, String> customData = new HashMap<String, String>();
customData.put("foo", "bar");
customData.put("boo", "baz");
// Create the application start event.
WTDataCollector.getInstance().onActivityPause("My Activity", customData);
super.onTerminate();
}
Webtrends parameters included in this event:
dcsuri
: "/activity/pause"WT.ti
: activityNameWT.pi
: activityNameWT.dl
: "61"WT.sys
: "pause"
In addition to these, all events contain the following Webtrends params:
Device Parameters
WT.ets
: Epoch Time Stamp, set at event creation timeWT.co
: Set Cookie on Redirect, always "yes"WT.dm
: Device Model, set by accessing \c android.os.Build.model and \c BUILD.manufacturer properties or "unknown"WT.os
: Operating System Version, reported by android.os.Build.VERSION.RELEASE or "unknown"WT.av
: Application Version, set by the wt_dc_app_version config setting or context.getPackageName()WT.a_nm
: Application Name, set by the wt_dc_app_name config setting or context.getApplicationInfo().labelResWT.a_dc
: Data Carrier, set by Context.TELEPHONY_SERVICEWT.ul
: Locale Language, set by Locale.getDefault().getDisplayLanguage()WT.uc
: Locale Country, set by Locale.getDefault().getDisplayCountry()WT.sr
: Screen Resolution, set by context.getSystemService(Context.WINDOW_SERVICE).getDefaultDisplay().getMetrics()WT.sdk_v
: SDK Version, set by BuildConfig.VERSION_NAMEWT.ct
: Connection Type,set by the CONNECTIVITY_SERVICE getActiveNetworkInfo()WT.g_co
: Country Code, set by the TELEPHONY_SERVICE getNetworkCountryIso()WT.d_id
: Unique ID, set by randomly generated ID(only included if the wt_dc_send_unique_id_enabled : config setting is set to true)WT.i_ornt
: Interface Orientation, set by the Display.getOrientation() method
Session Parameters
WT.vtvs
: Session Start, the start time of the current sessionWT.co_f
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_sid
: VisitorID.SessionStart, a concatenation of WT.co_f and WT.vtvs, joined with a "."WT.vtid
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_f
: First hit ever for this visitor, "1" if true, "0" if falseWT.vt_f_s
: First hit of the session for this visitor, "1" if true, "0" if falseWT.vt_f_d
: First hit of the day for this visitor, "1" if true, "0" if falseWT.vt_f_tlh
: Time of last hit
This method is called automatically when automatics are turned on (setting wt_dc_automatics_enabled = true). Automatic methods will be called without any custom params.
onActivityResume
onActivityResume(final String activityName,
final Map<String, String> customData
)
Generate an Activity Resume event (Automatically generated when automatic events are enabled)
When calling this method manually, it is recommended to place the call in the activity lifecycle such as in the Activity.onResume()
method.
Parameters
activityName
Specifies an activity name associated with this event.
customData
Specifies a series of custom name-value parameters used to pass data that is not included in the method.
Returns
Map<String, String>
- The collection of key/value pairs that make up the event (as a Map<String, String>). This may be discarded.
Example:
@Override
public void onResume() {
// Create some custom data, but this is optional:
Map<String, String> customData = new HashMap<String, String>();
customData.put("foo", "bar");
customData.put("boo", "baz");
// Create the application start event.
WTDataCollector.getInstance().onActivityResume("My Activity", customData);
super.onTerminate();
}
Webtrends parameters included in this event:
dcsuri
: "/activity/resume"WT.ti
: activityNameWT.pi
: activityNameWT.dl
: "61"WT.sys
: "resume"
In addition to these, all events contain the following Webtrends params:
Device Parameters
WT.ets
: Epoch Time Stamp, set at event creation timeWT.co
: Set Cookie on Redirect, always "yes"WT.dm
: Device Model, set by accessing \c android.os.Build.model and \c BUILD.manufacturer properties or "unknown"WT.os
: Operating System Version, reported by android.os.Build.VERSION.RELEASE or "unknown"WT.av
: Application Version, set by the wt_dc_app_version config setting or context.getPackageName()WT.a_nm
: Application Name, set by the wt_dc_app_name config setting or context.getApplicationInfo().labelResWT.a_dc
: Data Carrier, set by Context.TELEPHONY_SERVICEWT.ul
: Locale Language, set by Locale.getDefault().getDisplayLanguage()WT.uc
: Locale Country, set by Locale.getDefault().getDisplayCountry()WT.sr
: Screen Resolution, set by context.getSystemService(Context.WINDOW_SERVICE).getDefaultDisplay().getMetrics()WT.sdk_v
: SDK Version, set by BuildConfig.VERSION_NAMEWT.ct
: Connection Type,set by the CONNECTIVITY_SERVICE getActiveNetworkInfo()WT.g_co
: Country Code, set by the TELEPHONY_SERVICE getNetworkCountryIso()WT.d_id
: Unique ID, set by randomly generated ID(only included if the wt_dc_send_unique_id_enabled : config setting is set to true)WT.i_ornt
: Interface Orientation, set by the Display.getOrientation() method
Session Parameters
WT.vtvs
: Session Start, the start time of the current sessionWT.co_f
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_sid
: VisitorID.SessionStart, a concatenation of WT.co_f and WT.vtvs, joined with a "."WT.vtid
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_f
: First hit ever for this visitor, "1" if true, "0" if falseWT.vt_f_s
: First hit of the session for this visitor, "1" if true, "0" if falseWT.vt_f_d
: First hit of the day for this visitor, "1" if true, "0" if falseWT.vt_f_tlh
: Time of last hit
This method is called automatically when automatics are turned on (setting wt_dc_automatics_enabled = true). Automatic methods will be called without any custom params.
onActivityStart
onActivityStart(final String activityName,
final Map<String, String> customData
)
Generate an Activity Start event (Automatically generated when automatic events are enabled)
When calling this method manually, it is recommended to place the call early in the activity lifecycle such as in the Activity.onCreate()
method.
Parameters
activityName Specifies an activity name associated with this event.
customData Specifies a series of custom name-value parameters used to pass data that is not included in the method.
Returns
Map<String, String>
- The collection of key/value pairs that make up the event (as a Map<String, String>). This may be discarded.
Example:
@Override
public void onCreate() {
// Create some custom data, but this is optional:
Map<String, String> customData = new HashMap<String, String>();
customData.put("foo", "bar");
customData.put("boo", "baz");
// Create the application start event.
WTDataCollector.getInstance().onActivityStart("My Activity", customData);
super.onTerminate();
}
Webtrends parameters included in this event:
dcsuri
: "/activity/start"WT.ti
: activityNameWT.pi
: activityNameWT.dl
: "61"WT.sys
: "start"
In addition to these, all events contain the following Webtrends params:
Device Parameters
WT.ets
: Epoch Time Stamp, set at event creation timeWT.co
: Set Cookie on Redirect, always "yes"WT.dm
: Device Model, set by accessing \c android.os.Build.model and \c BUILD.manufacturer properties or "unknown"WT.os
: Operating System Version, reported by android.os.Build.VERSION.RELEASE or "unknown"WT.av
: Application Version, set by the wt_dc_app_version config setting or context.getPackageName()WT.a_nm
: Application Name, set by the wt_dc_app_name config setting or context.getApplicationInfo().labelResWT.a_dc
: Data Carrier, set by Context.TELEPHONY_SERVICEWT.ul
: Locale Language, set by Locale.getDefault().getDisplayLanguage()WT.uc
: Locale Country, set by Locale.getDefault().getDisplayCountry()WT.sr
: Screen Resolution, set by context.getSystemService(Context.WINDOW_SERVICE).getDefaultDisplay().getMetrics()WT.sdk_v
: SDK Version, set by BuildConfig.VERSION_NAMEWT.ct
: Connection Type,set by the CONNECTIVITY_SERVICE getActiveNetworkInfo()WT.g_co
: Country Code, set by the TELEPHONY_SERVICE getNetworkCountryIso()WT.d_id
: Unique ID, set by randomly generated ID(only included if the wt_dc_send_unique_id_enabled : config setting is set to true)WT.i_ornt
: Interface Orientation, set by the Display.getOrientation() method
Session Parameters
WT.vtvs
: Session Start, the start time of the current sessionWT.co_f
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_sid
: VisitorID.SessionStart, a concatenation of WT.co_f and WT.vtvs, joined with a "."WT.vtid
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_f
: First hit ever for this visitor, "1" if true, "0" if falseWT.vt_f_s
: First hit of the session for this visitor, "1" if true, "0" if falseWT.vt_f_d
: First hit of the day for this visitor, "1" if true, "0" if falseWT.vt_f_tlh
: Time of last hit
This method is called automatically when automatics are turned on (setting wt_dc_automatics_enabled = true). Automatic methods will be called without any custom params.
onAdClickEvent
onAdClickEvent(final String eventPath,
final String eventDesc,
final String eventType,
final Map< String, String > customData,
final String adName
)
Generate an Ad Click event
Parameters
eventPath
Specifies the hierarchical representation of an application view at the time of the event. For example, this parameter can specify an application path.
eventDesc
Specifies the representation of an application view at the time of the event. For example, this parameter can specify the name of a screen.
eventType
Specifies the type of event that occurred, such as a view or click.
customData
Specifies a series of custom name-value parameters used to pass data that is not included in the method.
adName
Specifies the name of the ad the user interacted with.
Returns
Map<String, String>
- The collection of key/value pairs that make up the event (as a Map<String, String>). This may be discarded.
Webtrends parameters included in this event:
dcsuri
: eventPath or "/activity/end" if eventPath is nullWT.ti
: eventDescWT.pi
: eventDescWT.dl
: "60"WT.sys
: "adclick"WT.ev
: eventTypeWT.a_an
: adNameWT.a_ac
: "1"
In addition to these, all events contain the following Webtrends params:
Device Parameters
WT.ets
: Epoch Time Stamp, set at event creation timeWT.co
: Set Cookie on Redirect, always "yes"WT.dm
: Device Model, set by accessing \c android.os.Build.model and \c BUILD.manufacturer properties or "unknown"WT.os
: Operating System Version, reported by android.os.Build.VERSION.RELEASE or "unknown"WT.av
: Application Version, set by the wt_dc_app_version config setting or context.getPackageName()WT.a_nm
: Application Name, set by the wt_dc_app_name config setting or context.getApplicationInfo().labelResWT.a_dc
: Data Carrier, set by Context.TELEPHONY_SERVICEWT.ul
: Locale Language, set by Locale.getDefault().getDisplayLanguage()WT.uc
: Locale Country, set by Locale.getDefault().getDisplayCountry()WT.sr
: Screen Resolution, set by context.getSystemService(Context.WINDOW_SERVICE).getDefaultDisplay().getMetrics()WT.sdk_v
: SDK Version, set by BuildConfig.VERSION_NAMEWT.ct
: Connection Type,set by the CONNECTIVITY_SERVICE getActiveNetworkInfo()WT.g_co
: Country Code, set by the TELEPHONY_SERVICE getNetworkCountryIso()WT.d_id
: Unique ID, set by randomly generated ID(only included if the wt_dc_send_unique_id_enabled : config setting is set to true)WT.i_ornt
: Interface Orientation, set by the Display.getOrientation() method
Session Parameters
WT.vtvs
: Session Start, the start time of the current sessionWT.co_f
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_sid
: VisitorID.SessionStart, a concatenation of WT.co_f and WT.vtvs, joined with a "."WT.vtid
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_f
: First hit ever for this visitor, "1" if true, "0" if falseWT.vt_f_s
: First hit of the session for this visitor, "1" if true, "0" if falseWT.vt_f_d
: First hit of the day for this visitor, "1" if true, "0" if falseWT.vt_f_tlh
: Time of last hit
onAdImpressionEvent
onAdImpressionEvent ( final String eventPath,
final String eventDesc,
final String eventType,
final Map< String, String > customData,
final String[] adNames
)
Parameters
eventPath
Specifies the hierarchical representation of an application view at the time of the event. For example, this parameter can specify an application path.
eventDesc
Specifies the representation of an application view at the time of the event. For example, this parameter can specify the name of a screen.
eventType
Specifies the type of event that occurred, such as a view or click.
customData
Specifies a series of custom name-value parameters used to pass data that is not included in the method.
adNames
An array of Strings ([String]) containing a list of ad names shown to the user
Returns
Map<String, String>
- The collection of key/value pairs that make up the event (as a Map<String, String>). This may be discarded.
Webtrends parameters included in this event:
dcsuri: eventPath or "/ad/impression" if eventPath is null
WT.ti
: eventDesc
WT.pi
: eventDesc
WT.dl
: "60"
WT.sys
: "adimpression"
WT.ev
: eventType
WT.a_an
: adNames as a semicolon-separated list e.g.:"adname1;adname2;adname3;..."
WT.a_ai
: a semicolon-separated list of "1"s the length of adnames e.g.: "1;1;1;..."
In addition to these, all events contain the following Webtrends params:
Device Parameters
WT.ets
: Epoch Time Stamp, set at event creation timeWT.co
: Set Cookie on Redirect, always "yes"WT.dm
: Device Model, set by accessing \c android.os.Build.model and \c BUILD.manufacturer properties or "unknown"WT.os
: Operating System Version, reported by android.os.Build.VERSION.RELEASE or "unknown"WT.av
: Application Version, set by the wt_dc_app_version config setting or context.getPackageName()WT.a_nm
: Application Name, set by the wt_dc_app_name config setting or context.getApplicationInfo().labelResWT.a_dc
: Data Carrier, set by Context.TELEPHONY_SERVICEWT.ul
: Locale Language, set by Locale.getDefault().getDisplayLanguage()WT.uc
: Locale Country, set by Locale.getDefault().getDisplayCountry()WT.sr
: Screen Resolution, set by context.getSystemService(Context.WINDOW_SERVICE).getDefaultDisplay().getMetrics()WT.sdk_v
: SDK Version, set by BuildConfig.VERSION_NAMEWT.ct
: Connection Type,set by the CONNECTIVITY_SERVICE getActiveNetworkInfo()WT.g_co
: Country Code, set by the TELEPHONY_SERVICE getNetworkCountryIso()WT.d_id
: Unique ID, set by randomly generated ID(only included if the wt_dc_send_unique_id_enabled : config setting is set to true)WT.i_ornt
: Interface Orientation, set by the Display.getOrientation() method
Session Parameters
WT.vtvs
: Session Start, the start time of the current sessionWT.co_f
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_sid
: VisitorID.SessionStart, a concatenation of WT.co_f and WT.vtvs, joined with a "."WT.vtid
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_f
: First hit ever for this visitor, "1" if true, "0" if falseWT.vt_f_s
: First hit of the session for this visitor, "1" if true, "0" if falseWT.vt_f_d
: First hit of the day for this visitor, "1" if true, "0" if falseWT.vt_f_tlh
: Time of last hit
onApplicationError
onApplicationError(final String applicationName,
final Map< String, String >customData
)
Generate an Application Error event
This is NOT an automatic event. It must be called manually when an error is detected.
Parameters
applicationName
Specifies an application name associated with application startup, application termination, application foreground, application background, or application error.
customData
Specifies a series of custom name-value parameters used to pass data that is not included in the method.
Returns
Map<String, String>
- The collection of key/value pairs that make up the event (as a Map<String, String>). This may be discarded.
Example:
if (error != null) {
// Create some custom data, but this is optional:
Map<String, String> customData = new HashMap<String, String>();
customData.put("Error Message", "Something bad happened");
customData.put("data", "The big bad wolf blew my house in!");
// Create the application error event.
WTDataCollector.getInstance().onApplicationError("My Application", customData);
}
Webtrends parameters included in this event:
dcsuri
: "/application/error"WT.ti
: applicationNameWT.pi
: applicationNameWT.dl
: "61"WT.sys
: "error"
In addition to these, all events contain the following Webtrends params:
Device Parameters
WT.ets
: Epoch Time Stamp, set at event creation timeWT.co
: Set Cookie on Redirect, always "yes"WT.dm
: Device Model, set by accessing \c android.os.Build.model and \c BUILD.manufacturer properties or "unknown"WT.os
: Operating System Version, reported by android.os.Build.VERSION.RELEASE or "unknown"WT.av
: Application Version, set by the wt_dc_app_version config setting or context.getPackageName()WT.a_nm
: Application Name, set by the wt_dc_app_name config setting or context.getApplicationInfo().labelResWT.a_dc
: Data Carrier, set by Context.TELEPHONY_SERVICEWT.ul
: Locale Language, set by Locale.getDefault().getDisplayLanguage()WT.uc
: Locale Country, set by Locale.getDefault().getDisplayCountry()WT.sr
: Screen Resolution, set by context.getSystemService(Context.WINDOW_SERVICE).getDefaultDisplay().getMetrics()WT.sdk_v
: SDK Version, set by BuildConfig.VERSION_NAMEWT.ct
: Connection Type,set by the CONNECTIVITY_SERVICE getActiveNetworkInfo()WT.g_co
: Country Code, set by the TELEPHONY_SERVICE getNetworkCountryIso()WT.d_id
: Unique ID, set by randomly generated ID(only included if the wt_dc_send_unique_id_enabled : config setting is set to true)WT.i_ornt
: Interface Orientation, set by the Display.getOrientation() method
Session Parameters
WT.vtvs
: Session Start, the start time of the current sessionWT.co_f
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_sid
: VisitorID.SessionStart, a concatenation of WT.co_f and WT.vtvs, joined with a "."WT.vtid
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_f
: First hit ever for this visitor, "1" if true, "0" if falseWT.vt_f_s
: First hit of the session for this visitor, "1" if true, "0" if falseWT.vt_f_d
: First hit of the day for this visitor, "1" if true, "0" if falseWT.vt_f_tlh
: Time of last hit
onApplicationStart
onApplicationStart(final String applicationName,
final Map< String, String > customData
)
Generate an Application Start event (Automatically generated when automatic events are enabled)
If you call this method manually, it should be called at the beginning of the application lifecycle, such as the Activity.onCreate() method.
Parameters
applicationName
Specifies an application name associated with application startup, application termination, application foreground, application background, or application error.
customData
Specifies a series of custom name-value parameters used to pass data that is not included in the method.
Returns
Map<String, String>
- The collection of key/value pairs that make up the event (as a Map<String, String>). This may be discarded.
Example:
private void onCreate(Bundle savedInstanceState) {
// Create some custom data, but this is optional:
Map<String, String> customData = new HashMap<String, String>();
customData.put("foo", "bar");
customData.put("boo", "baz");
// Create the application start event.
WTDataCollector.getInstance().onApplicationStart("My Application", customData);
}
Webtrends parameters included in this event:
dcsuri
: "/application/start"WT.ti
: applicationNameWT.pi
: applicationNameWT.dl
: "61"WT.sys
: "startup"
In addition to these, all events contain the following Webtrends params:
Device Parameters
WT.ets
: Epoch Time Stamp, set at event creation timeWT.co
: Set Cookie on Redirect, always "yes"WT.dm
: Device Model, set by accessing \c android.os.Build.model and \c BUILD.manufacturer properties or "unknown"WT.os
: Operating System Version, reported by android.os.Build.VERSION.RELEASE or "unknown"WT.av
: Application Version, set by the wt_dc_app_version config setting or context.getPackageName()WT.a_nm
: Application Name, set by the wt_dc_app_name config setting or context.getApplicationInfo().labelResWT.a_dc
: Data Carrier, set by Context.TELEPHONY_SERVICEWT.ul
: Locale Language, set by Locale.getDefault().getDisplayLanguage()WT.uc
: Locale Country, set by Locale.getDefault().getDisplayCountry()WT.sr
: Screen Resolution, set by context.getSystemService(Context.WINDOW_SERVICE).getDefaultDisplay().getMetrics()WT.sdk_v
: SDK Version, set by BuildConfig.VERSION_NAMEWT.ct
: Connection Type,set by the CONNECTIVITY_SERVICE getActiveNetworkInfo()WT.g_co
: Country Code, set by the TELEPHONY_SERVICE getNetworkCountryIso()WT.d_id
: Unique ID, set by randomly generated ID(only included if the wt_dc_send_unique_id_enabled : config setting is set to true)WT.i_ornt
: Interface Orientation, set by the Display.getOrientation() method
Session Parameters
WT.vtvs
: Session Start, the start time of the current sessionWT.co_f
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_sid
: VisitorID.SessionStart, a concatenation of WT.co_f and WT.vtvs, joined with a "."WT.vtid
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_f
: First hit ever for this visitor, "1" if true, "0" if falseWT.vt_f_s
: First hit of the session for this visitor, "1" if true, "0" if falseWT.vt_f_d
: First hit of the day for this visitor, "1" if true, "0" if falseWT.vt_f_tlh
: Time of last hit
This method is called automatically when automatics are turned on (setting wt_dc_automatics_enabled = true). Automatic methods will be called without any custom params.
onApplicationTerminate
onApplicationTerminate(final String applicationName,
final Map< String, String > customData
)
Generate an Application Terminate event
In automatic mode, this method will only work on an emulator. It will never be called on a production Android device, where processes are removed by simply killing them. No user code (including the onTerminate()
method) will be called.
If you want to invoke this method manually, you must put it in a block of code that is sure to be called when your application terminates.
Parameters
applicationName
Specifies an application name associated with application startup, application termination, application foreground, application background, or application error.
customData
Specifies a series of custom name-value parameters used to pass data that is not included in the method.
Returns
Map<String, String>
- The collection of key/value pairs that make up the event (as a Map<String, String>). This may be discarded.
Example:
public void mySpecialApplicationTerminateMethod() {
// Create some custom data, but this is optional:
Map<String, String> customData = new HashMap<String, String>();
customData.put("foo", "bar");
customData.put("boo", "baz");
// Create the application start event.
WTDataCollector.getInstance().onApplicationTerminate("My Application", customData);
super.onTerminate();
}
Webtrends parameters included in this event:
dcsuri
: "/application/terminate"WT.ti
: applicationNameWT.pi
: applicationNameWT.dl
: "61"WT.sys
: "exit"
In addition to these, all events contain the following Webtrends params:
Device Parameters
WT.ets
: Epoch Time Stamp, set at event creation timeWT.co
: Set Cookie on Redirect, always "yes"WT.dm
: Device Model, set by accessing \c android.os.Build.model and \c BUILD.manufacturer properties or "unknown"WT.os
: Operating System Version, reported by android.os.Build.VERSION.RELEASE or "unknown"WT.av
: Application Version, set by the wt_dc_app_version config setting or context.getPackageName()WT.a_nm
: Application Name, set by the wt_dc_app_name config setting or context.getApplicationInfo().labelResWT.a_dc
: Data Carrier, set by Context.TELEPHONY_SERVICEWT.ul
: Locale Language, set by Locale.getDefault().getDisplayLanguage()WT.uc
: Locale Country, set by Locale.getDefault().getDisplayCountry()WT.sr
: Screen Resolution, set by context.getSystemService(Context.WINDOW_SERVICE).getDefaultDisplay().getMetrics()WT.sdk_v
: SDK Version, set by BuildConfig.VERSION_NAMEWT.ct
: Connection Type,set by the CONNECTIVITY_SERVICE getActiveNetworkInfo()WT.g_co
: Country Code, set by the TELEPHONY_SERVICE getNetworkCountryIso()WT.d_id
: Unique ID, set by randomly generated ID(only included if the wt_dc_send_unique_id_enabled : config setting is set to true)WT.i_ornt
: Interface Orientation, set by the Display.getOrientation() method
Session Parameters
WT.vtvs
: Session Start, the start time of the current sessionWT.co_f
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_sid
: VisitorID.SessionStart, a concatenation of WT.co_f and WT.vtvs, joined with a "."WT.vtid
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_f
: First hit ever for this visitor, "1" if true, "0" if falseWT.vt_f_s
: First hit of the session for this visitor, "1" if true, "0" if falseWT.vt_f_d
: First hit of the day for this visitor, "1" if true, "0" if falseWT.vt_f_tlh
: Time of last hit
This method is called automatically when automatics are turned on (setting wt_dc_automatics_enabled = true). Automatic methods will be called without any custom params.
onButtonClick
onButtonClick (final String eventPath,
final String eventDesc,
final String eventType,
final Map< String, String > customData
)
Generate a Button Click event.
Parameters
eventPath
Specifies the hierarchical representation of an application view at the time of the event. For example, this parameter can specify an application path.
eventDesc
Specifies the representation of an application view at the time of the event. For example, this parameter can specify the name of a screen.
eventType
Specifies the type of event that occurred, such as a view or click.
customData
Specifies a series of custom name-value parameters used to pass data that is not included in the method.
Returns
Map<String, String>
- The collection of key/value pairs that make up the event (as a Map<String, String>). This may be discarded.
Example:
findViewById(R.id.sendEventButton).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Create some custom data, but this is optional:
Map<String, String> customData = new HashMap<String, String>();
customData.put("foo", "bar");
customData.put("boo", "baz");
// Create the button click event.
WTDataCollector.getInstance().onButtonClick("My/event/path", "My Event Description", "My Event Type", customData);
}
});
Webtrends parameters included in this event:
dcsuri
: eventPath or "/button" ifeventPath
is nullWT.ti
: eventDescWT.pi
: eventDescWT.ev
: eventTypeWT.sys
: "button"WT.dl
: "60"
In addition to these, all events contain the following Webtrends params:
Device Parameters
WT.ets
: Epoch Time Stamp, set at event creation timeWT.co
: Set Cookie on Redirect, always "yes"WT.dm
: Device Model, set by accessing \c android.os.Build.model and \c BUILD.manufacturer properties or "unknown"WT.os
: Operating System Version, reported by android.os.Build.VERSION.RELEASE or "unknown"WT.av
: Application Version, set by the wt_dc_app_version config setting or context.getPackageName()WT.a_nm
: Application Name, set by the wt_dc_app_name config setting or context.getApplicationInfo().labelResWT.a_dc
: Data Carrier, set by Context.TELEPHONY_SERVICEWT.ul
: Locale Language, set by Locale.getDefault().getDisplayLanguage()WT.uc
: Locale Country, set by Locale.getDefault().getDisplayCountry()WT.sr
: Screen Resolution, set by context.getSystemService(Context.WINDOW_SERVICE).getDefaultDisplay().getMetrics()WT.sdk_v
: SDK Version, set by BuildConfig.VERSION_NAMEWT.ct
: Connection Type,set by the CONNECTIVITY_SERVICE getActiveNetworkInfo()WT.g_co
: Country Code, set by the TELEPHONY_SERVICE getNetworkCountryIso()WT.d_id
: Unique ID, set by randomly generated ID(only included if the wt_dc_send_unique_id_enabled : config setting is set to true)WT.i_ornt
: Interface Orientation, set by the Display.getOrientation() method
Session Parameters
WT.vtvs
: Session Start, the start time of the current sessionWT.co_f
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_sid
: VisitorID.SessionStart, a concatenation of WT.co_f and WT.vtvs, joined with a "."WT.vtid
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_f
: First hit ever for this visitor, "1" if true, "0" if falseWT.vt_f_s
: First hit of the session for this visitor, "1" if true, "0" if falseWT.vt_f_d
: First hit of the day for this visitor, "1" if true, "0" if falseWT.vt_f_tlh
: Time of last hit
onConversionEvent
onConversionEvent (final String eventPath,
final String eventDesc,
final String eventType,
final Map< String, String > customData,
final String contentGroup,
final String conversionName
)
Parameters
eventPath
Specifies the hierarchical representation of an application view at the time of the event. For example, this parameter can specify an application path.
eventDesc
Specifies the representation of an application view at the time of the event. For example, this parameter can specify the name of a screen.
eventType
Specifies the type of event that occurred, such as a view or click.
customData
Specifies a series of custom name-value parameters used to pass data that is not included in the method.
contentGroup
Specifies a group of related application views.
conversionName
Specifies the name used to identify a customer conversion.
Returns
Map<String, String>
- The collection of key/value pairs that make up the event (as a Map<String, String>). This may be discarded.
Webtrends parameters included in this event:
dcsuri
: eventPath or "/conversion" if eventPath is nullWT.ti
: eventDescWT.pi
: eventDescWT.dl
: "0"WT.sys
: "conversion"WT.ev
: eventTypeWT.cg_n
: contentGroupWT.conv
: conversionNameWT.si_cs
: "1"
In addition to these, all events contain the following Webtrends params:
Device Parameters
WT.ets
: Epoch Time Stamp, set at event creation timeWT.co
: Set Cookie on Redirect, always "yes"WT.dm
: Device Model, set by accessing \c android.os.Build.model and \c BUILD.manufacturer properties or "unknown"WT.os
: Operating System Version, reported by android.os.Build.VERSION.RELEASE or "unknown"WT.av
: Application Version, set by the wt_dc_app_version config setting or context.getPackageName()WT.a_nm
: Application Name, set by the wt_dc_app_name config setting or context.getApplicationInfo().labelResWT.a_dc
: Data Carrier, set by Context.TELEPHONY_SERVICEWT.ul
: Locale Language, set by Locale.getDefault().getDisplayLanguage()WT.uc
: Locale Country, set by Locale.getDefault().getDisplayCountry()WT.sr
: Screen Resolution, set by context.getSystemService(Context.WINDOW_SERVICE).getDefaultDisplay().getMetrics()WT.sdk_v
: SDK Version, set by BuildConfig.VERSION_NAMEWT.ct
: Connection Type,set by the CONNECTIVITY_SERVICE getActiveNetworkInfo()WT.g_co
: Country Code, set by the TELEPHONY_SERVICE getNetworkCountryIso()WT.d_id
: Unique ID, set by randomly generated ID(only included if the wt_dc_send_unique_id_enabled : config setting is set to true)WT.i_ornt
: Interface Orientation, set by the Display.getOrientation() method
Session Parameters
WT.vtvs
: Session Start, the start time of the current sessionWT.co_f
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_sid
: VisitorID.SessionStart, a concatenation of WT.co_f and WT.vtvs, joined with a "."WT.vtid
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_f
: First hit ever for this visitor, "1" if true, "0" if falseWT.vt_f_s
: First hit of the session for this visitor, "1" if true, "0" if falseWT.vt_f_d
: First hit of the day for this visitor, "1" if true, "0" if falseWT.vt_f_tlh
: Time of last hit
onCustomEvent
onCustomEvent(final String eventPath,
final String eventDesc,
final Map<String, String> customData
)
Generate a Custom event
Parameters
eventPath
Specifies the hierarchical representation of an application view at the time of the event. For example, this parameter can specify an application path.
eventDesc
Specifies the representation of an application view at the time of the event. For example, this parameter can specify the name of a screen.
customData
Specifies a series of custom name-value parameters used to pass data that is not included in the method.
Returns
Map<String, String>
- The collection of key/value pairs that make up the event (as a Map<String, String>). This may be discarded.
Example:
findViewById(R.id.sendEventButton).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Create some custom data, but this is optional:
Map<String, String> customData = new HashMap<String, String>();
customData.put("foo", "bar");
customData.put("boo", "baz");
// Create the custom event.
WTDataCollector.getInstance().onCustomEvent("My/event/path", "My Event Description", customData);
}
});
Webtrends parameters included in this event:
dcsuri
: eventPath/custom (where eventPath is the eventPath parameter for this methodWT.ti
: eventDescWT.pi
: eventDescWT.dl
: "0"WT.sys
: "custom"
In addition to these, all events contain the following Webtrends params:
Device Parameters
WT.ets
: Epoch Time Stamp, set at event creation timeWT.co
: Set Cookie on Redirect, always "yes"WT.dm
: Device Model, set by accessing \c android.os.Build.model and \c BUILD.manufacturer properties or "unknown"WT.os
: Operating System Version, reported by android.os.Build.VERSION.RELEASE or "unknown"WT.av
: Application Version, set by the wt_dc_app_version config setting or context.getPackageName()WT.a_nm
: Application Name, set by the wt_dc_app_name config setting or context.getApplicationInfo().labelResWT.a_dc
: Data Carrier, set by Context.TELEPHONY_SERVICEWT.ul
: Locale Language, set by Locale.getDefault().getDisplayLanguage()WT.uc
: Locale Country, set by Locale.getDefault().getDisplayCountry()WT.sr
: Screen Resolution, set by context.getSystemService(Context.WINDOW_SERVICE).getDefaultDisplay().getMetrics()WT.sdk_v
: SDK Version, set by BuildConfig.VERSION_NAMEWT.ct
: Connection Type,set by the CONNECTIVITY_SERVICE getActiveNetworkInfo()WT.g_co
: Country Code, set by the TELEPHONY_SERVICE getNetworkCountryIso()WT.d_id
: Unique ID, set by randomly generated ID(only included if the wt_dc_send_unique_id_enabled : config setting is set to true)WT.i_ornt
: Interface Orientation, set by the Display.getOrientation() method
Session Parameters
WT.vtvs
: Session Start, the start time of the current sessionWT.co_f
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_sid
: VisitorID.SessionStart, a concatenation of WT.co_f and WT.vtvs, joined with a "."WT.vtid
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_f
: First hit ever for this visitor, "1" if true, "0" if falseWT.vt_f_s
: First hit of the session for this visitor, "1" if true, "0" if falseWT.vt_f_d
: First hit of the day for this visitor, "1" if true, "0" if falseWT.vt_f_tlh
: Time of last hit
onMediaEvent
onMediaEvent(final String eventPath,
final String eventDesc,
final String eventType,
final Map< String, String > customData,
final String contentGroup,
final String mediaName,
final String mediaType,
final String mediaEventType
)
Parameters
eventPath
Specifies the hierarchical representation of an application view at the time of the event. For example, this parameter can specify an application path.
eventDesc
Specifies the representation of an application view at the time of the event. For example, this parameter can specify the name of a screen.
eventType
Specifies the type of event that occurred, such as a view or click.
customData
Specifies a series of custom name-value parameters used to pass data that is not included in the method.
contentGroup
Specifies a group of related application views.
mediaName
Specifies the name of the media content accessed during an event, for example the name of a video clip.
mediaType
Specifies a type of media accessed during the event, such as QuickTime or mp3.
mediaEventType
Specifies the type of media event that occurred, such as a view of media content.
Returns
Map<String, String>
- The collection of key/value pairs that make up the event (as a Map<String, String>). This may be discarded.
Webtrends parameters included in this event:
dcsuri
: eventPath or "/media" if eventPath is nullWT.ti
: eventDescWT.pi
: eventDescWT.dl
: "60"WT.sys
: "media"WT.ev
: eventTypeWT.cg_n
: contentGroupWT.clip_ev
: mediaEventTypeWT.clip_n
: mediaNameWT.clip_t
: mediaType
In addition to these, all events contain the following Webtrends params:
Device Parameters
WT.ets
: Epoch Time Stamp, set at event creation timeWT.co
: Set Cookie on Redirect, always "yes"WT.dm
: Device Model, set by accessing \c android.os.Build.model and \c BUILD.manufacturer properties or "unknown"WT.os
: Operating System Version, reported by android.os.Build.VERSION.RELEASE or "unknown"WT.av
: Application Version, set by the wt_dc_app_version config setting or context.getPackageName()WT.a_nm
: Application Name, set by the wt_dc_app_name config setting or context.getApplicationInfo().labelResWT.a_dc
: Data Carrier, set by Context.TELEPHONY_SERVICEWT.ul
: Locale Language, set by Locale.getDefault().getDisplayLanguage()WT.uc
: Locale Country, set by Locale.getDefault().getDisplayCountry()WT.sr
: Screen Resolution, set by context.getSystemService(Context.WINDOW_SERVICE).getDefaultDisplay().getMetrics()WT.sdk_v
: SDK Version, set by BuildConfig.VERSION_NAMEWT.ct
: Connection Type,set by the CONNECTIVITY_SERVICE getActiveNetworkInfo()WT.g_co
: Country Code, set by the TELEPHONY_SERVICE getNetworkCountryIso()WT.d_id
: Unique ID, set by randomly generated ID(only included if the wt_dc_send_unique_id_enabled : config setting is set to true)WT.i_ornt
: Interface Orientation, set by the Display.getOrientation() method
Session Parameters
WT.vtvs
: Session Start, the start time of the current sessionWT.co_f
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_sid
: VisitorID.SessionStart, a concatenation of WT.co_f and WT.vtvs, joined with a "."WT.vtid
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_f
: First hit ever for this visitor, "1" if true, "0" if falseWT.vt_f_s
: First hit of the session for this visitor, "1" if true, "0" if falseWT.vt_f_d
: First hit of the day for this visitor, "1" if true, "0" if falseWT.vt_f_tlh
: Time of last hit
onProductView
onProductView (final String eventPath,
final String eventDesc,
final String eventType,
final Map< String, String > customData,
final String contentGroup,
final String productId,
final String productSku
)
Parameters
eventPath
Specifies the hierarchical representation of an application view at the time of the event. For example, this parameter can specify an application path.
eventDesc
Specifies the representation of an application view at the time of the event. For example, this parameter can specify the name of a screen.
eventType
Specifies the type of event that occurred, such as a view or click.
customData
Specifies a series of custom name-value parameters used to pass data that is not included in the method.
contentGroup
Specifies a group of related application views.
productId
Specifies a product identifier.
productSku
Specifies a unique product stock-keeping unit (SKU) number.
Returns
Map<String, String>
- The collection of key/value pairs that make up the event (as a Map<String, String>). This may be discarded.
Webtrends parameters included in this event:
dcsuri
: eventPath or "/product/view" if eventPath is nullWT.ti
: eventDescWT.pi
: eventDescWT.dl
: "0"WT.sys
: "product"WT.ev
: eventTypeWT.cg_n
: contentGroupWT.pn_id
: productIdWT.pn_sku
: productSku
In addition to these, all events contain the following Webtrends params:
Device Parameters
WT.ets
: Epoch Time Stamp, set at event creation timeWT.co
: Set Cookie on Redirect, always "yes"WT.dm
: Device Model, set by accessing \c android.os.Build.model and \c BUILD.manufacturer properties or "unknown"WT.os
: Operating System Version, reported by android.os.Build.VERSION.RELEASE or "unknown"WT.av
: Application Version, set by the wt_dc_app_version config setting or context.getPackageName()WT.a_nm
: Application Name, set by the wt_dc_app_name config setting or context.getApplicationInfo().labelResWT.a_dc
: Data Carrier, set by Context.TELEPHONY_SERVICEWT.ul
: Locale Language, set by Locale.getDefault().getDisplayLanguage()WT.uc
: Locale Country, set by Locale.getDefault().getDisplayCountry()WT.sr
: Screen Resolution, set by context.getSystemService(Context.WINDOW_SERVICE).getDefaultDisplay().getMetrics()WT.sdk_v
: SDK Version, set by BuildConfig.VERSION_NAMEWT.ct
: Connection Type,set by the CONNECTIVITY_SERVICE getActiveNetworkInfo()WT.g_co
: Country Code, set by the TELEPHONY_SERVICE getNetworkCountryIso()WT.d_id
: Unique ID, set by randomly generated ID(only included if the wt_dc_send_unique_id_enabled : config setting is set to true)WT.i_ornt
: Interface Orientation, set by the Display.getOrientation() method
Session Parameters
WT.vtvs
: Session Start, the start time of the current sessionWT.co_f
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_sid
: VisitorID.SessionStart, a concatenation of WT.co_f and WT.vtvs, joined with a "."WT.vtid
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_f
: First hit ever for this visitor, "1" if true, "0" if falseWT.vt_f_s
: First hit of the session for this visitor, "1" if true, "0" if falseWT.vt_f_d
: First hit of the day for this visitor, "1" if true, "0" if falseWT.vt_f_tlh
: Time of last hit
onScreenView
onScreenView (final String eventPath,
final String eventDesc,
final String eventType,
final Map< String, String > customData,
final String contentGroup
)
Parameters
eventPath
Specifies the hierarchical representation of an application view at the time of the event. For example, this parameter can specify an application path.
eventDesc
Specifies the representation of an application view at the time of the event. For example, this parameter can specify the name of a screen.
eventType
Specifies the type of event that occurred, such as a view or click.
customData Specifies a series of custom name-value parameters used to pass data that is not included in the method.
contentGroup
Specifies a group of related application views.
Returns
Map<String, String>
- The collection of key/value pairs that make up the event (as a Map<String, String>). This may be discarded.
Webtrends parameters included in this event:
dcsuri
: eventPath or "/screen/view" if eventPath is nullWT.ti
: eventDescWT.pi
: eventDescWT.dl
: "0"WT.sys
: "screen"WT.ev
: eventTypeWT.cg_n
: contentGroup
In addition to these, all events contain the following Webtrends params:
Device Parameters
WT.ets
: Epoch Time Stamp, set at event creation timeWT.co
: Set Cookie on Redirect, always "yes"WT.dm
: Device Model, set by accessing \c android.os.Build.model and \c BUILD.manufacturer properties or "unknown"WT.os
: Operating System Version, reported by android.os.Build.VERSION.RELEASE or "unknown"WT.av
: Application Version, set by the wt_dc_app_version config setting or context.getPackageName()WT.a_nm
: Application Name, set by the wt_dc_app_name config setting or context.getApplicationInfo().labelResWT.a_dc
: Data Carrier, set by Context.TELEPHONY_SERVICEWT.ul
: Locale Language, set by Locale.getDefault().getDisplayLanguage()WT.uc
: Locale Country, set by Locale.getDefault().getDisplayCountry()WT.sr
: Screen Resolution, set by context.getSystemService(Context.WINDOW_SERVICE).getDefaultDisplay().getMetrics()WT.sdk_v
: SDK Version, set by BuildConfig.VERSION_NAMEWT.ct
: Connection Type,set by the CONNECTIVITY_SERVICE getActiveNetworkInfo()WT.g_co
: Country Code, set by the TELEPHONY_SERVICE getNetworkCountryIso()WT.d_id
: Unique ID, set by randomly generated ID(only included if the wt_dc_send_unique_id_enabled : config setting is set to true)WT.i_ornt
: Interface Orientation, set by the Display.getOrientation() method
Session Parameters
WT.vtvs
: Session Start, the start time of the current sessionWT.co_f
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_sid
: VisitorID.SessionStart, a concatenation of WT.co_f and WT.vtvs, joined with a "."WT.vtid
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_f
: First hit ever for this visitor, "1" if true, "0" if falseWT.vt_f_s
: First hit of the session for this visitor, "1" if true, "0" if falseWT.vt_f_d
: First hit of the day for this visitor, "1" if true, "0" if falseWT.vt_f_tlh
: Time of last hit
onSearchEvent
onSearchEvent(final String eventPath,
final String eventDesc,
final String eventType,
final Map< String, String > customData,
final String searchPhrase,
final String searchResult
)
Parameters
eventPath
Specifies the hierarchical representation of an application view at the time of the event. For example, this parameter can specify an application path.
eventDesc
Specifies the representation of an application view at the time of the event. For example, this parameter can specify the name of a screen.
eventType
Specifies the type of event that occurred, such as a view or click.
customData
Specifies a series of custom name-value parameters used to pass data that is not included in the method.
searchPhrase
Specifies the string that was used to search (optional)
searchResult
Specifies the search results (optional)
Returns
Map<String, String>
- The collection of key/value pairs that make up the event (as a Map<String, String>). This may be discarded.
Webtrends parameters included in this event:
dcsuri
: eventPath or "/search" if eventPath is nullWT.ti
: eventDescWT.pi
: eventDescWT.dl
: "0"WT.sys
: "search"WT.ev
: eventTypeWT.oss
: searchPhraseWT.oss_r
: searchResult
In addition to these, all events contain the following Webtrends params:
Device Parameters
WT.ets
: Epoch Time Stamp, set at event creation timeWT.co
: Set Cookie on Redirect, always "yes"WT.dm
: Device Model, set by accessing \c android.os.Build.model and \c BUILD.manufacturer properties or "unknown"WT.os
: Operating System Version, reported by android.os.Build.VERSION.RELEASE or "unknown"WT.av
: Application Version, set by the wt_dc_app_version config setting or context.getPackageName()WT.a_nm
: Application Name, set by the wt_dc_app_name config setting or context.getApplicationInfo().labelResWT.a_dc
: Data Carrier, set by Context.TELEPHONY_SERVICEWT.ul
: Locale Language, set by Locale.getDefault().getDisplayLanguage()WT.uc
: Locale Country, set by Locale.getDefault().getDisplayCountry()WT.sr
: Screen Resolution, set by context.getSystemService(Context.WINDOW_SERVICE).getDefaultDisplay().getMetrics()WT.sdk_v
: SDK Version, set by BuildConfig.VERSION_NAMEWT.ct
: Connection Type,set by the CONNECTIVITY_SERVICE getActiveNetworkInfo()WT.g_co
: Country Code, set by the TELEPHONY_SERVICE getNetworkCountryIso()WT.d_id
: Unique ID, set by randomly generated ID(only included if the wt_dc_send_unique_id_enabled : config setting is set to true)WT.i_ornt
: Interface Orientation, set by the Display.getOrientation() method
Session Parameters
WT.vtvs
: Session Start, the start time of the current sessionWT.co_f
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_sid
: VisitorID.SessionStart, a concatenation of WT.co_f and WT.vtvs, joined with a "."WT.vtid
: Visitor ID, the unique visitor ID assigned to this sessionWT.vt_f
: First hit ever for this visitor, "1" if true, "0" if falseWT.vt_f_s
: First hit of the session for this visitor, "1" if true, "0" if falseWT.vt_f_d
: First hit of the day for this visitor, "1" if true, "0" if falseWT.vt_f_tlh
: Time of last hit
openUrl
openUrl(final Activity activity,
final String url
)
Open the website from your application, using the Webtrends helper method to load the URL. This appends user and session information to the URL that the JavaScript plug-in parses and uses for its configuration.
Parameters
activity
The activity in which to open the URL (usually this).
url
The destination URL
pauseEventTransmission
pauseEventTransmission ( )
Pause event transmission. Events will continue to collect in local storage, but they will not be transmitted to the Webtrends data collection servers. If the number of events stored locally exceeds the value of wt_dc_event_table_size_maximum (max persisted events), then older events will be dropped as new ones are generated.
resumeEventTransmission
resumeEventTransmission ( )
Resume event transmission. If event transmission is paused, it will now be resumed. This method also triggers an event send to be called, sending a batch of events to data collection.
setConfigSetting
setConfigSetting(final String key,
final String value,
final boolean persist
)
Sets the value of a Webtrends config setting or your own configuration setting.
Parameters
key
The String key to set the value of
value
The String value to set. All values are stored as strings. If you want to set a numeric value, you must submit it as a string. e.g. "1000"
persist
boolean, set to true if you want the configuration setting to be persisted across app restarts, false if not.
Returns
Boolean
- true if the setting was set correctly, false if it failed. Failure would be caused by the value not passing validation. For example, trying to set a boolean config value to a numeric value would fail and return false.
setRcsMetadata
setRcsMetadata(final String key,
final String value
)
Sets a custom key/value pair that will be used for RCS calls (if RCS is enabled). These key/valu pairs will be sent with every RCS request and can be used by the RCS server's rules.
Parameters
key
The String key to set the value of
value
The String value to set. All values are stored as strings. If you want to set a numeric value, you must submit it as a string. e.g. "1000"
setSessionInfo
setSessionInfo (Activity activity)
A convenience method that attaches hybrid session data to a hybrid activity. This method must be called to manually track events from a web page in a hybrid application. It sets the session start time, last event time, and visitor ID for the web session, which can be read and used by a web page tagged with the Webtrends tag.
Parameters
activity
The current activity containing a webView.
transmitAllEvents( )
transmitAllEvents( )
Transmit all events in the local data store. If there are more events in the local data store than the size of wt_dc_events_per_send, then multiple send events will be triggered until the local event storage has been drained.
Normal restrictions on sending events still apply such as battery life, wifi availability, etc.
transmitEvents ( )
transmitEvents ( )
Send a batch of events to the data collector. This will send one and only one batch. If the value of wt_dc_events_per_send is greater than the number of events stored locally, then all events in the local data store will be transmitted.
Normal restrictions on sending events still apply such as battery life, wifi availability, etc.
Optimize classes are available but no longer supported by Webtrends.
The documentation for this class was generated from the following file:
WTDataCollector.java