WebEngage stores every datapoint in local database and sends them periodically to server in a background thread when a certain criteria is met. The criteria is based on the number of events in local database and last synced time.
WebEngage allows you to change the event reporting behaviour during SDK initialization, so that you can make events sync faster to WebEngage if available connectivity is good.
using Com.Webengage.Sdk.Android.Actions.Database; ... WebEngageConfig config = new WebEngageConfig.Builder() .SetEventReportingStrategy(ReportingStrategy.Buffer) .Build(); RegisterActivityLifecycleCallbacks(new WebEngageActivityLifeCycleCallbacks(this, config));
Alternatively you can also change this behaviour anytime during application lifecycle using below API.
using Com.Webengage.Sdk.Android.Actions.Database; ... WebEngage.Get().SetEventReportingStrategy(ReportingStrategy.Buffer);
SetEventReportingStrategyis to be called only once in a session. The SDK remembers this setting unless your app is restarted.
By default, the reporting strategy is set to
ReportingStrategy for details.
Returns WebEngage configuration. See
WebEngageConfig for details.
WebEngageConfig weConfig = WebEngage.Get().WebEngageConfig;
You can enable/disable logs from WebEngage SDK during SDK initialization as shown below.
using Com.Webengage.Sdk.Android; ... WebEngageConfig config = new WebEngageConfig.Builder() .SetDebugMode(true) .Build(); RegisterActivityLifecycleCallbacks(new WebEngageActivityLifeCycleCallbacks(this, config));
Alternatively, you can change log level anytime using below API.
This is to be used only in development mode.
WebEngage Xamarin.Android SDK allows you to define location tracking accuracy, or to disable location tracking, which enables you to optimize for resources - device battery and data usage. Follow the steps below to set location tracking accuracy.
Xamarin.GooglePlayServices.Locationfrom Nuget Package Manager.
- Add the below location permission in your AndroidManifest.xml file under the Properties folder of your project.
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
SetLocationTrackingStrategyto define location tracking accuracy. Note that this method is to be called after WebEngage SDK initialization.
using Com.Webengage.Sdk.Android; ... WebEngageConfig config = new WebEngageConfig.Builder() ... .SetLocationTrackingStrategy(LocationTrackingStrategy.AccuracyCity) .Build();
using Com.Webengage.Sdk.Android; ... WebEngage.Get().SetLocationTrackingStrategy(LocationTrackingStrategy.AccuracyBest);
Following are the options that you can use to define location tracking accuracy.
Location accuracy level
Uses the highest level of accuracy. Recommended for using geofencing; consumes more device power.
Recommended for city-level location tracking; consumes less device power.
Recommended for country-level location tracking; consumes less power.
Disables location tracking by WebEngage SDK. With this value, WebEngage will neither track any user location nor update it on your WebEngage dashboard.
If you are using this configuration, you can manage location updates by using
Apps targeting Android Marshmallow and above would need to request location permission from user and set location tracking to
false from permission request callback depending on whether location permission is granted or not.
Updated over 2 years ago