Migrating from SDK v4 to v5
    • 2 Minutes to read
    • Dark
      Light

    Migrating from SDK v4 to v5

    • Dark
      Light

    Article summary

    Key Improvements and Changes in Android SDK v5

    Android SDK v5 introduces significant improvements and additional features over v4, including:

    • New Features:

      • Form tracking to capture user input.

      • Ability to change the Track ID and Track Domain at runtime (useful for apps with multiple languages or accounts).

    • Improved Data Quality:

      • Requests are now stored in a database instead of app files.

      • Requests can be sent in batches, preserving correct page navigation paths.

      • Uses WorkManager for reliable request handling.

      • WebViews are tracked entirely within the app’s context.

      • Improved campaign tracking for better accuracy.

    • Enhanced Debugging:

      • Detailed logs for easier debugging and monitoring.

      • Performance and Battery Optimization:

      • Optimized performance and reduced battery usage.

    Android SDK v5 relies on WorkManager to store and send requests, which ensures reliable data transmission with a minimum send interval of 15 minutes (maximum: 60 minutes). We recommend enabling batch support and using the client timestamp for accurate page duration calculations. Contact your account manager to enable the client timestamp in your account.

    SDK v5 no longer supports configuration via Tag Integration. Configuration must now be done directly in the app as described in the documentation.

    Steps for Migration

    To ensure a smooth migration from Android SDK v4 to Android SDK v5, it is crucial to preserve the existing customer everID data. Failing to migrate properly can result in the creation of new users/visitors in Mapp Intelligence after app updates.

    1. Implement SDK v5
      Follow the instructions in the documentation to implement SDK v5 in your application. You can use either  query based or object oriented tracking.

    2. Enable the Migration Function
      Ensure you enable the migration function in the global configuration to preserve existing customer data:

      class SampleApplication : Application() {
       
           override fun onCreate() {
               super .onCreate()
       
               val webtrekkConfigurations =
                   WebtrekkConfiguration.Builder(listOf( "track Id" ), "track domain" )
                       .enableMigration()
                       .build()
       
               Webtrekk.getInstance().init( this , webtrekkConfigurations)
           }
      }
      public class SampleApplication extends Application {
       
           @Override
           public void onCreate() {
           super .onCreate();
       
           List<String> trackIds = new ArrayList<>();
           trackIds.add( "track id" );
       
           WebtrekkConfiguration webtrekkConfiguration = new WebtrekkConfiguration.Builder(trackIds, "track domain" )
               .enableMigration()
               .build();
       
           Webtrekk.getInstance().init( this , webtrekkConfiguration);
         }
      }
    3. Remove SDK v4 Configuration
      Make sure to remove any configuration related to Android SDK v4 from your application. This is necessary to prevent duplicate tracking of user interactions. Leaving both SDKs enabled could result in tracking the same interactions twice.

    Key Points

    • Preserve customer everID data during migration to avoid creating new user profiles in Mapp Intelligence.

    • Enable the migration function to keep existing data intact.

    • Remove all SDK v4 configurations to prevent duplicate tracking.


    Was this article helpful?