You are here: Developers > OpenX Bidder for Apps Android > Bidder for Apps self-testing

Bidder for Apps self-testing

Last updated on May 31, 2017

Once you have set up the adapter integration, you will be ready for testing delivery. Before sending a test build to OpenX, you can perform a self-test to verify your setup. You can also refer to the setup checklist to ensure that you are completing each step of the process.

Note: If you are expecting live ads through the OpenX Ad Exchange, a valid User Agent and IP address are required. Additionally, testing with a real device that does not have ad tracking limited will help buyers bid on the inventoryAd space available on a website or app. The basic unit of inventory for OpenX is an ad unit..

1. Check for correct domain and ad units.

iOS

2016-11-11 13:47:31.685 BFAObjC[43928:19314242] OpenX BidderForApps 2.0.0: [WARN] Bad server response - [Adunits field empty in JSON response!]

Android

11-14 09:46:01.796 7626-7626/com.openx.openx_appstore_demo W/OpenXBidder: OpenX BidderForApps v2.0.0 - Bad server response - [Adunits field empty in JSON response!]

Verify that the domain, ad unit, and bundle ID/application ID are correct. If so, and you still see this error, contact OpenX and send us your Charles log.

2. Turn on logging as described in iOS adapter integration or Android adapter integration.

3. Download and install Charles Web Proxy: https://www.charlesproxy.com/.

This will allow you to observe network traffic coming from iOS simulators and devices and diagnose issues with your BidderOpenX's header bidding solution. Bidder enables publishers to realize the true value of their direct and indirect inventory in real time. "Bidder" can also mean a program designed to bid in real time on inventory in the OpenX Ad Exchange. for Apps installation. It works with simulators right out of the box. To get it working with a device, you'll have to take a few extra steps:

4. Set up SSL Proxying in Charles.

Go to Help -> SSL Proxying -> Install Charles Root Certificate in iOS Simulators:

Charles SSL proxying

Then, go to Proxy -> SSL Proxy Settings. Enable SSL proxying and add "ads.mopub.com" as a location to be proxied.

MoPub proxy in Charles

You should now be able to inspect the contents of ad requests to MoPub:

Charles cache key

5. Use Charles to verify network requests, click tracking, and keywords passing correctly.

It's recommended that you use a filter like this: "openx|mopub" – otherwise, you'll have to sift through a lot of unrelated traffic. This is an example of a bannerThis is an ad that appears on a web page which is typically hyperlinked to an advertiser’s website. Banners can be images (GIF, JPEG, PNG), JavaScript programs or multimedia objects (For example, Java). ad requestCommunication from a web browser or app to an ad server to display an ad. where OpenX wins the bid:

These are the items you should see (look at the Path column):

  1. /ma/1.0/acj - The ad request to OpenX
  2. /ma/1.0/bo - A Bid Outcome call to let OpenX know how the bid turned out
  3. /m/ad – The ad request to MoPub
  4. /m/imp - ImpressionA single display of an ad on a web page, mobile app, or other delivery medium. For deals, impression is a metric to relay the total number of ads that have served. See also billable impression, forecasted impressions. sent to MoPub
  5. /ma/1.0/acj - Another ad request to OpenX to get a second ad ready, for when the banner refreshes
  6. /ma/1.0/ri - Impression sent to OpenX
  7. /ma/1.0/bo - The Bid Outcome call for the second ad request to OpenX
  8. /ma/1.0/rc - Click sent to OpenX, when the OpenX ad is clicked
  9. /m/aclk - Click sent to MoPub, when the OpenX ad is clicked

Confirm that the "q" param contains m_cache_key and m_ox. If it does not, you may not be specifying your keywords correctly. OpenX provides a convenient method for setting and removing keywords without disrupting any special keywords that might already be in place:

iOS

- (void)receiveBid:(OXMBidderResponseContainer *) container {
	/*
	In order to compete with MoPub on price, we need to update the ad unit's 
	keywords so that the appropriately priced OpenX line item will be selected.
 
	By default the line items in MoPub should be setup to target keywords in the format 
	of `m_ox:%%preBidValue%%` where %%preBidValue%% is the value received from 
	OXMBidderResponseContainer.preBidValue. Since MPAdView.keywords is just an NSString, 
	care should be taken to properly append our keywords. MoPub's format is a comma (,) 
	delimited string of key/value pairs (key:value).
	*/
				
	self.mpAdView.keywords = [container setOpenXKeywords:self.mpAdView.keywords];
 
	if (self.firstLoad) {
		dispatch_async(dispatch_get_main_queue(), ^{
			[self.mpAdView loadAd];
		});
		self.firstLoad = NO;
	}
}
 
- (void)bidFail:(NSError *) error {
	/*
	OpenX's bid request failed. This can be because there is no fill from OpenX or the 
	request exceeded the set `clientTimeout`. In either case, you proceed with the MoPub 
	request without an OpenX price.
	*/
				
	self.mpAdView.keywords = [OXMBidderResponseContainer removeOpenXKeywords:self.mpAdView.keywords];
 
	if (self.firstLoad) {
		dispatch_async(dispatch_get_main_queue(), ^{
			[self.mpAdView loadAd];
		});
		self.firstLoad = NO;
	}
	}
		

Android


@Override
public void receiveBid(BidderResponseContainer bidderResponseContainer) {
	/*
	In order to compete with MoPub on price, we need to update the ad unit's
	keywords so that the appropriately priced OpenX line item will be
	selected. By default the line items in MoPub should be setup to target
	keywords in the format of `m_ox:%%preBidValue%%` where %%preBidValue%% is 
	the value received from OXMBidderResponseContainer.preBidValue. Since 
	MPAdView.keywords is just a String, care should be taken to properly append 
	our keywords. MoPub's format is a comma (,) delimited string of key/value 
	pairs (key:value). Use OXMBidderResponseContainer.setOpenXKeywords() to do 
	this for you.
	*/
mopubAdView.setKeywords(bidderResponseContainer.setOpenXKeywords(mopubAdView.getKeywords()));
...   
}
 
@Override
public void bidFail(AdError error) {
	/*
	OpenX's bid request failed. This can be because there is no fill from
	OpenX or the request exceeded the set `clientTimeout`. In either case,
	you proceed with the MoPub request without an OpenX price. Please make sure
	to remove any previously set OpenX keywords. See 
	OXMBidderResponseContainer.removeOpenXKeywords() for how to do it in your 
	app.
	*/        
...
mopubAdView.loadAd(); 
}

		

When OpenX wins the bid and a banner or interstitialA full-screen ad displayed in content transitions. For example, a video ad that loads between levels of a mobile game. is clicked on, you should see two distinct click events: one sent to MoPub and one sent to OpenX:

Common log messages

Message Description

Bid Received

This is a healthy response. If you want to see fewer of these, consider setting the logLevel to Warning or Silent.

Ad unit mapping failed. Please make sure your delivery domain (<domain>), Bundle ID (<bundle_id>) and third party ad unit (<ad_unit>) are correct.

This means you have your domain set incorrectly. It could also mean that the mapping file is not set up correctly on OpenX's server.

Client timeout invoked

You're using a BidderManager (not a Queued Bidder Manager) and it ran out of time to return a bid. If this is happening consistently, consider increasing your value for clientTimeout.

No ad

OpenX responded, but there is no bid in the response.

No bid

An ad response was received, but it had a pub_rev_rounded value of 0.

Bad server response

Please see the self-test steps above. If you cannot resolve the issue, please let us know, as this may be an OpenX error.

OpenX Internal Server Error

This is an error on OpenX's part. Please let us know.

Provide build to OpenX

Once you have completed your self-test, notify your OpenX representative that you are ready to submit a build of your app for final testing.

Feedback form