Analytics and Location

This page explains how to configure the SDK to store data in a particular geographic region.

Introduction

If your application requires data to remain in a specific geographic region you can set a marker in your configuration to inform the BVAnalytics module within Bazaarvoice Android SDK. It's recommended that this be set in your Bazaarvoice Configuration File, however, if you have a need to explore the locale determination programmatically, continue reading.

Example

The code below demonstrate how to make the locale determination programmatically:

public class MyApplication extends Application {
  @Override
  public void onCreate(){
    super.onCreate();
 
    Locale defaultLocale = ...; // Grab the proper locale of the user
 
    BVSDK.builder(application, BazaarEnvironment.PRODUCTION)
                  .analyticsDefaultLocale(defaultLocale)
                  .build();
  }
}

πŸ“˜

The Bazaarvoice Android SDK will try its best to determine a default value (it will use the user's current region setting), however, it is highly recommended that you configure this value so that you are in accordance with any of the various data privacy regulations. Also, for a discussion on the various levels of Locale supported by Android please see their documentation on the topic.