This method takes in 2 parameters, the event name and the Bundle object having event parameters.
All the events defined before with JSON payload can also be transmitted using a bundle payload. The process to transmit the `registration_complete` event is explained below. Other events can be transmitted in a similar fashion.
final Button button = (Button) findViewById(R.id.sendEventButton);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Log.v(TAG, "Sample App Send Event");
// Steps
// 1.) Define a bundle object to put custom event parameters
Bundle bundle = new Bundle();
// 2.) Put custom event parameters in the bundle
bundle.putString("registration_source", "google ads");
// 3.) Track the click event by calling the RSClient track method.
// RSClient supports different flavours of track method. Since here we have the
// event parameters as bundle object so call the track method which expects action name
// and bundle as arguments
RSClient.track("registration_complete", bundle);
// The above call will transmit the event to Retention Science endpoint.
// If setStagingEnvironment is called then the event will be transmitted
// to the Retention Science staging endpoint. By default if these methods are not called
// every event is transmitted to production endpoint.
}
});
Comments
0 comments
Please sign in to leave a comment.