The post below is deprecated Starting on Android SDK 2.4 the API for conversion have been streamlined. The information below was only valid between Android SDK V2.2 and V2.4. This page is only here for historical purposes. Check the updated blogpost for integration using the latest SDK
The “Conversion” feature enables you to measure user interactions with beacons and campaigns. With this feature you can track the following informations:
Currently we have following 3 conversion types
/**
* Action was given to the host app, but host app did not return confirmation
* that it made attempt to show it to the user. This is the situation where e.g.
* app delays showing notification to the user for whatever reason.
*/
public static final int TYPE_SUPPRESSED = -1;
/**
* App has confirmed via SensorbergSdk#notifyActionShowAttempt(UUID, Context)
* that the action was shown to the user by notification or otherwise.
*/
public static final int TYPE_IGNORED = 0;
/**
* App has confirmed via SensorbergSdk#notifyActionSuccess(UUID, Context)
* that the user acknowledged the action (e.g. user opened notification).
*/
public static final int TYPE_SUCCESS = 1;
Conversion lifecycle
Conversion begins its life as “Suppressed” when our Android SDK generates the Action, even before it’s passed to the host app. This requires no work on your host application side.
Next stage is marking the Action as “Ignored”, which means that you’ve attempted to show it to the user, but you have no knowledge if the user interacted with your notification / alert. To do this call:
SensorbergSdk.notifyActionShowAttempt(sdkAction.getUuid(), context);
Last stage is marking the Action as “Success” which means that user interacted with your notification. For this to happen call:
SensorbergSdk.notifyActionSuccess(sdkAction.getUuid(), context);
Please note:
ActionReceiver class have been deprecated and removed
In case you need out-of-the-box solution that works with conversions and Notifications we’ve got you covered. Extend the abstract ActionReceiver class and supply your Notification in onGetNotification, plus implement onAction (or onVisitWebsiteAction / onInAppAction / onUriAction if you want to be more specific) callbacks, and the rest of conversion will happen automatically when user taps on it. Remember to put the ActionReceiver extended class in AndroidManifest.xml and use remote process for it.
<receiver
android:name=".receivers.MyActionReceiver"
android:exported="false"
android:process=".sensorberg">
<intent-filter>
<action android:name="com.sensorberg.android.PRESENT_ACTION"/>
<action android:name="com.sensorberg.android.CONVERSION_SUCCESS"/>
<action android:name="com.sensorberg.android.CONVERSION_DELETE"/>
</intent-filter>
</receiver>