Analytics & 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 iOS SDK. We recommend 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 demonstrats how to make the locale determination programmatically:

let configDict = [ ..., /// Other API Keys
  "analyticsLocaleIdentifier" : "YOUR_LOCALE_VALUE"];
BVSDKManager.configure(withConfiguration: configDict, configType: .staging)
NSDictionary *configDict = @{
  ..., /// Other API Keys
  @"analyticsLocaleIdentifier" : @"YOUR_LOCALE_VALUE"
};
[BVSDKManager configureWithConfiguration:configDict
                              configType:BVConfigurationTypeStaging];
let configDict = [// ..., /// Other API Keys
                                      "analyticsLocaleIdentifier" : "YOUR_LOCALE_VALUE"];
         if let analyticsConfig = BVAnalyticsConfiguration(.staging(clientId: ""), keyValues: configDict) {
                 BVManager.sharedManager.addConfiguration(analyticsConfig)
          }

📘

The Bazaarvoice SKD for iOS will attempt to determine a default value (it will use the user's current region setting), however, we highly recommend 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 Apple please see their documentation on the topic.