-
Notifications
You must be signed in to change notification settings - Fork 8
Advertising
The Advertising module allows use of Bazaarvoice's powerful shopper segment data with Google Mobile Ads. The BVAdvertising is architected so that you can use all aspects of the DFP (Doubleclick For Publishers) SDK easily, with Bazaarvoice's shopper segment functionality built in.
Refer to Installation for full instructions.
Include Maven Central repository and add Common and Advertising modules to dependencies
dependencies {
compile 'com.bazaarvoice.bvandroidsdk:common:3.0.0'
compile 'com.bazaarvoice.bvandroidsdk:advertising:3.0.0'
}
repositories {
mavenCentral()
}
The Ads SDK must be instantiated with your valid Bazaarvoice Shopper Advertising API key. For optimal performance manage a single instance at a time. Below is an example of how to instantiate the Ads component:
import com.bazaarvoice.bvandroidsdk.Ads;
public class MainActivity extends Activity {
Ads ads;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ads = new BVAds("YOUR_API_KEY");
}
}
Once a user is authenticated inside your user login workflow, set user information on your Ads
instance.
NOTE: The userAuthString created with your existing Bazaarvoice implementation logic needs to be given to the
Ads
instance. However, the steps to encrypt your userAuthString are still applicable even if you are not a Conversations client.
The user auth string is an encrypted query string. In the documentation above, date=20070527&userid=ID12345
is used as an example. This is then encrypted/signed appropriately, for security. You should add information (such as identity, demographics) in this query string, for example: date=20070527&userid=ID12345&facebookId=abc123&age=28&gender=female
. Allowed keys (*userid,age, email, facebookId, gender, twitterId) are defined in SomeFile.java
. This information can then be safely passed to an Ads instance like below:
This user below interested in "pets", "powersports", "gamefish" and others. See the Contextual Interests section below for further explanation. Following the example above:
ads.setUserWithAuthString(aa05cf391c8d4738efb4d05f7b2ad7ce7573657269643d4f6d6e694368616e6e656c50726f66696c65313226656d61696c3d6a61736f6e406a61736f6e2e636f6d);
Once setUserWithAuthString
has been called, Bazaarvoice's back-end systems will begin matching data to this user's profile. This process is near real-time, but not instant. The SDK will poll to update the user profile and should reflect the user's interests within seconds.
Google Mobile Ads SDK is included within this sdk. BVAdvertising subclasses Google's various classes to provide correct user personalization, while still leaving all of Google Mobile Ads SDK power in your hands.
Full details on implementing Google Mobile Ads in iOS can be found here.
Targeted ads must be setup in Doubleclick For Publishers (DFP). Contact Bazaarvoice about setting up targeted ads in DFP. You will need to obtain an Ad Unit ID to use Ads SDK.
During implementation, use your Ads
instance to obtain instances of PublisherAdRequest.Builder
, PublisherAdView
, PublisherInterstitialAd
, and AdLoader.Builder
instead of the respective DFP constructors. Use BVAdListener
and BVContentAdLoadedListener
instead of using AdListener
and ContentAdLoadedListener
.
See DFP's documentation on implementing native ads which explains the entire process in detail. It is very important to follow DFP's implementation guide to properly implement native ads.
A working example is provided in the example project in (NativeAdFragment
)
See DFP's documentation on implementing Banner Ads which fully explains the process. It is very important to follow DFP's implementation guide to properly implement banner ads.
A working example is provided in the example project in (BannerAdFragment
).
See DFP's documentation on Interstitial Ads which explains the entire process of creating an interstitial ad. It is very important to follow DFP's implementation guide to properly implement interstitial ads.
A working example is provided in the example project (InterstitialAdFragment
).
BVAdvertising is structured around categories that products belong to. The list is fully defined in ContextualInterests.java
. It is split into two tiers, with about 30 tier one categories, all with multiple sub-categories (tier two).
For example, the Women's dresses section of a Target store would correspond to:
-
tier one:
TierOneApparelAndAccessories
-
tier two:
TierTwoApparelAndAccessoriesWomensDresses
Similarly, the Television section of a BestBuy store would correspond to:
-
tier one:
TierOneConsumerElectronics
-
tier two:
TierTwoConsumerElectronicsTelevisions
NOTE: All tier two categories are extensions of their tier one category names. Contextual Interest categories are used while sending location information to BVAdvertising, as defined below.
Ads provides many ways to integrate location data into a shopper's profile.
All location related methods can be found in Ads.java
, but a couple notes:
-
All location methods have
contextualTier1
andcontextualTier2
parameters. This allows you to send all location->interest mapping information available to Ads in order to give the shopper the best profile possible. SeeContextualInterests.java
for a generated list of Contextual Tier 1 and Tier 2 strings. - We define methods that correlate strongly to
LocationListener
interface methods -- and provide an example usage of CLLocationManager+BVAdvertising inside theEXAMPLE
file. - We also define methods that correlate strongly to Gimbal
PlaceEventListener
interface methods. Similarly, we provide an example usage of Gimbal+BVAdvertising in theEXAMPLE
file.
© 2016 Bazaarvoice, Inc.
Use of this SDK is contingent on your agreement and conformance with Bazaarvoice's API Terms of Use. Additionally, you agree to store all data acquired by this SDK or Bazaarvoice’s API only within the storage of the individual application instance using the SDK or API. You also agree to use the data acquired by the SDK or API only within the context of the same individual application instance and only for purposes consistent with that application’s purpose. Except as otherwise noted, the Bazaarvoice iOS SDK licensed under the Apache License, Version 2.0.