Get Started with Avocarrot

Overview

Examples

Android

Overview

- Avocarrot Exchange SDK

Setup Exchange SDK

Stream

Native Assets

Exchange Troubleshooting

- Avocarrot Mediation SDK

Setup Mediation

Stream Ads Mediation

Native ads Mediation

Native Assets Mediation

Banner Mediation

Interstitial Mediation

Video Mediation

Supported Networks & Ad Types

Mediation Troubleshooting

iOS

Overview

- Avocarrot Exchange SDK

Setup SDK

Stream

Native Assets

Exchange Troubleshooting

- Avocarrot Mediation

Getting Started With Mediation

Stream Ads Mediation

Native Ads Mediation

Banner Ads Mediation

Interstitial Ads Mediation

Video Ads Mediation

Supported Networks & Ad Types

Mediation Troubleshooting

API Documentation

Reporting API

Help

FAQ

Updates

SDK Change Log

Android Change Log

iOS Change Log

Mediation Troubleshooting

Updated a month ago ​by Chris

Overview

The default log level is INFO. From the adb shell, you can change the log level to DEBUG, VERBOSE etc. using this command:

setprop log.tag.Ampiri_SDK DEBUG
setprop log.tag.MRAID DEBUG
setprop log.tag.VAST DEBUG

If you want to log debug information, please install Ampiri.setDebugMode(true) (false by default), then you will see the logs under Ampiri_SDK tag. It is recommended that this option should be used for integration test purposes.

Common Issues

There is no ad request to networks configured. Why?

If it’s a client library network, your app should have the network’s adapter. And the network should be in your waterfall.

Why are my in-feed ads loading slowly?

If you are using in-feed native ads, you can leverage our ad caching to avoid ad latency issues when your users are scrolling through your app feed.

Avocarrot Mediation SDK has a cache system for in-feed ads with specific sizes (deviates according to platforms). When you initialise in-feed ads, they will start loading and our SDK caches the in-feed ads when loading has completed. After this, they can be inserted into your feed without any delays. The ad must be shown to the user before it can load a new ad into the cache system.

See “How do I reduce ad latency?” more information on ad latency.

AND

Below is a quick guide on how to use in-feed caching. It explains how to load your ads before showing them to improve the display in your in-feed.

Step 1:

Initialize your in-feed with StreamAdAdapter using the dummy data anywhere in the app before showing your feed (( Before users go to your ListView (ad placement))

i.e. you can put any dummy adapter instead of your ListView adapter in the following line

  .setAdapter(new MainAdapter(this))

or instead of ViewBuilder, you can also use any dummy builder.

.setViewBuilder(FeedCardNativeAdView.BUILDER)

Step 2:

Call

.loadAd()

Ads will start to load into the cache, so that they are ready to be shown.

Step 3:

When users view your ListView, you can create another StreamAdAdapter with the same ad unit ID in your ListView.

Step 4:

Call

.loadAd()

The same ads will be displayed from the cache since these ads have not yet been shown.

Note: If you are planning to load the ads in the same activity as your listview, you can simply reuse the same StreamAdAdapter and set the values accordingly to your listview. 

Native ad render view being null in In-feed

Please check if you integrate in-feed ads using our streamAdAdapter instead of using NativeAd. For in-feed or Listview, our SDK provides a streamAdAdapter to build the native ad.

Add the following code to your activity:

StreamAdAdapter adAdapter = new StreamAdAdapter.Builder()
  .setAdapter(new MainAdapter(this))
  .setAdUnitId("YOUR_NATIVE_AD_UNIT_ID")
  .setViewBuilder(FeedCardNativeAdView.BUILDER)
  .setEventCallback(this)
  .build(this);
listView.setAdapter(adAdapter);
adAdapter.loadAd();

Why are my ads taking a while to load?

An ad can take some time to load due to the ad latency. This is the total time it takes for a server to receive and process a request. If our SDK integration was installed correctly, then the ad should serve without any lag time. But remember, ad latency can still depend on various external factors. The more layers (services or operations) you add to the integration, the greater the possibility for latency to occur.

Some external factors that affect latency include:

  • Ad networks and their 3rd party integrations
  • Countries
  • Platforms
  • Internet connection
  • Device version
  • Ad units
  • Configuration of the app


For further information on how to reduce latency, please refer to our recommendations here.

How do I reduce ad latency?

Our recommendations to minimize latency would be the following:

1. Consider implementing pre-loaded ads since it’s considered best practice and helps reduce overall ad latency. As a publisher, you have full control to separate the events to “showing and loading”. We recommend you to implement this method.

Go through our detailed steps to pre-load Banner ad before showing it. 

Step 1: Set the adview “INVISIBLE”.

The ad view needs to be INVISIBLE before requesting an ad. you can either do it in their layout .xml, or You can add codes like below in the code.

e.g.

bannerView.setVisibility(View.INVISIBLE);

Step 2: Load an ad.

After calling the loadAd(); method, the downloading of banner starts.

e.g.

StandardAd standardAd = new StandardAd(this, adView, "YOUR_STANDARD_AD_UNIT_ID",  BannerSize.BANNER_SIZE_320x50, adListener);
StandardAd.loadAd();

Step 3: Set the adview “VISIBLE” and Show ad.

When users go to the ad placement, you can show the pre-loaded ad.

Please make sure that the adview for banner must be VISIBLE when you call showAd(); method. It will then trigger an impression event.

e.g.

bannerView.setVisibility(View.VISIBLE);
StandardAd.showAd();

See “Why are my in-feed ads loading slowly?” for instruction on how to pre-load In-feed ads.

2. Integrate with our S2S networks as the round-trip time would be much faster and direct.

What is the ad latency with a third party SDK network?

Avocarrot has always kept in mind the number of networks in the ecosystem and the possibility of ad network congestions which lead to latency. We do have full transparency with our own S2S integrations, but do not have any visibility on the latency with third party ad networks. These scenarios are out of our control, which is why we strive to ensure our ad latency from our server and API integrations are as minimal as possible.

In addition, every SDK network operates differently and therefore, their latencies and performances can vary depending on the ad network. 

Below is an example of the total time interval between the SDK, Avocarrot server and a third-party ad network. 

  • Total load time of ads: 9.7s
  • Time interval between the Avocarrot Mediation SDK and Avocarrot Server: 1s
  • Time interval between the SDK and third-party ad network: 8.7s



You can also check the ad latency with S2S/API integrations. And here are some additional tips to reduce the ad latency. 

What is the ad latency with your API/S2S integrations?

The most optimal end-to-end latency for Avocarrot would be with our API integrations since there are no third party SDKs involved. The average minimum round trip is ~500ms. A round-trip is the total time required for a request to be sent and back again with a response. The latency for any given round-trip includes the following interactions:

  • Avocarrot Mediation SDK sends a request to the Avocarrot server
  • Avocarrot server processes the request and sends the request to the ad network
  • Ad network responds back to the Avocarrot server
  • Avocarrot server sends the final response to the Avocarrot Mediation SDK

Below is an example of the total load time with a S2S ad network. This shows the communication between the SDK and Avocarrot server is much faster and direct, which enables an optimal end-to-end latency.

S2S Ad Network

  • Total load time of ads: 2s
  • 10:36.00.600 ~ 10:36:02.601


You can also check the ad latency with a third-party sdk network. And here are some additional tips to reduce the ad latency.  

I’ve integrated the SDK but don’t see any impressions. What do I do?

There are two possible reasons you might not be seeing any impressions: Integration or Configuration.

1: Integration
Ideally, you can use the Demo app and enter your Ad Unit ID. This can be found in your dashboard under each ad placement as “Click to copy Ad Unit ID”.

Now, insert this Ad Unit ID in the Demo App. If the ad is served in the demo app, but not within YOUR app, then there is an integration issue.
If this is the case, please reach out to us and we will happily assist you!
You will be required to provide the following information:
– The Ampiri SDK integration code
– Set the app on the debug mode
– Logs for ad request

 

2: Configuration
If you entered the Ad Unit ID in the demo app and still did not see any ads served, then there is a configuration mistake. To resolve the issue, you will have to re-check the configuration and make sure all the ad placement IDs are correct.

For any additional information, please refer to our guidelines HERE:
Android: https://github.com/ampiri/ampiri-android-sdk/blob/master/HOWTO.md

Are there any limitations when working with other networks on non-arm processors?

No, there aren’t any limitations by working with other networks. Some ad networks are using a 3rd party library to support haptic-enhanced advertisements and it’s only supported by arm devices. We have decided to exclude this functionality to support a wider range of devices! Therefore, you can easily exclude this library and “haptic” functionality.

The banner and native ads show they are loaded but nothing is displayed on the screen. What do I do?

The issue have to do with the activity events, onResume etc. Please add the codes below into your app and try again. 

 @Override
public void onResume() {
super.onResume();
if (standardAd != null) {
standardAd.onActivityResumed();
if (autoUpdateView != null) {
autoUpdateView.setChecked(standardAd.isAutoRefreshEnable());
}
}
}@Override
public void onPause() {
super.onPause();
if (standardAd != null) {
standardAd.onActivityPaused();
}  

You can find more details on our github page! If you still experience this error, please send the full logs to us.


Was this article useful?