Skip to content

Advertising

Sergio Azua edited this page Jan 13, 2016 · 25 revisions

Summary

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.

App Gradle - Add dependencies

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()
}

Instantiating the Ads SDK

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");
    }
}

Adding information about the user

The user auth string is an encrypted query string. In the documentation above, date=2007­0527&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=2007­0527&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:

Example Auth String - for testing purposes

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 setUser 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

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

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.

Serving Native Ads with BVAdvertising

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 (Insert Demo here)

Serving Banner Ads with BVAdvertising

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 (Insert Demo Here).

Serving Interstitial Ads with BVAdvertising

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 (Insert Demo Here).


Contextual Interests

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.


###TODO

BVAdvertising + User Location

BVAdvertising provides many ways to integrate location data into a shopper's profile.
All location related methods can be found in BVLocationEventsHelper.h, but a couple notes:

  • All location methods have contextualTier1 and contextualTier2 parameters. This allows you to send all location->interest mapping information available to BVAdvertising in order to give the shopper the best profile possible. See BVContextualInterests.h for a generated list of Contextual Tier 1 and Tier 2 strings.
  • We define methods that correlate strongly to CLLocationManagerDelegate methods -- and provide an example usage of CLLocationManager+BVAdvertising inside the LocationExample file.
  • We also define methods that correlate strongly to Gimbal Beacon delegate methods, specifically GMBLPlaceManagerDelegate and GMBLBeaconManagerDelegate. Similarly, we provide an example usage of Gimbal+BVAdvertising in the GimbalExample file.