adform / adform-ios-sdk

adform-ios-sdk
MIT License
8 stars 8 forks source link

Slow ad loading #25

Closed aparedes closed 5 years ago

aparedes commented 6 years ago

Hi We are experiencing some slow loading ads, 3~5+ seconds per ad. This looks bad in the app as there is a hole in between the content while waiting for the ad. We don't want to collapse the content and then open it up when the ad is loaded as that will only make the app hope around.

Is there something we are missing or something that could help us make the experience faster?

This is how we load the ad:

- (void)loadAd {
  dispatch_async(dispatch_get_main_queue(), ^{
    _inlineAd = [[AFAdInline alloc] initWithMasterTagId:masterTagId 
    presentingViewController:_rootViewController];
    _inlineAd.frame = CGRectMake(0, 0, adWidth, adHeight);
    [_inlineAd setAdSize:CGSizeMake(adWidth, adHeight)];
    [_inlineAd setAdTransitionStyle:AFAdTransitionStyleNone];
    [_inlineAd setDelegate:self];
    [self addSubview:_inlineAd];
    [_inlineAd loadAd];
  });
}

The delegate:

- (void)adInlineDidLoadAd:(AFAdInline *)adInline {
  if (self.onAdDidLoad) {
    self.onAdDidLoad(@{ @"loaded": @YES});
  }
}

- (void)adInlineDidFailToLoadAd:(AFAdInline *)adInline withError:(NSError *)error {
  if (self.onAdFailedToLoad) {
    self.onAdFailedToLoad(@{ @"error": @{ @"message": [error localizedDescription] } });
  }
}

- (void)adInlineWillChangeSize:(AFAdInline *)adInline toSize:(CGSize)newSize {
  if (self.onAdSizeChange) {
    self.onAdSizeChange(@{ @"height": [NSNumber numberWithDouble:newSize.height], @"width": [NSNumber numberWithDouble:newSize.width] });
  }
}

We have also tried setting this, but did no difference:

[AdformSDK setBannerLoadingBehaviour:AFBannerLoadingBehaviourInstant];
[AdformSDK setPublisherId:_publisherId andCustomData:nil];
andriusmisiunas commented 6 years ago

Hello,

Could you provide a sample project with the implementation of just the SDK and the problematic tags? If the [AdformSDK setBannerLoadingBehaviour:AFBannerLoadingBehaviourInstant]; setting did not work, it should not be SDK related, rather an issue with the network calls. If you could provide a Charles network traffic recording it would be very helpful too.

Thank you!

aparedes commented 6 years ago

https://github.com/EkstraBladetUdvikling/eb-apps-adform-demo Its a react-native app

I did a charles session but dont know if its correct https://github.com/EkstraBladetUdvikling/eb-apps-adform-demo/raw/master/adform.chls

andriusmisiunas commented 6 years ago

Hi,

The charles log looks correct - and it seems the ad was delivered in ~2 seconds.

A question however - while using the demo app, we don't get any banners - have the campaigns been turned off? Could you please turn them on?

Thanks! Andrius

aparedes commented 6 years ago

It seems that the large ad (320x320) loads "fast" ~2 sec. But the smaller ones (320x160) IF they load (its rare that they do) it takes between 3 and 5 seconds to load, but when it gets rejected ( which is almost always) it is almost immediately.

The ads are turned on

andriusmisiunas commented 6 years ago

Hi,

So far we are having a hard time reproducing the problem. We did launch the app, but it never shows any ads - none are returned from ADX. Could you maybe adjust targeting? We suspect that it may be some third party tag that lags rendering - but we need to see it in action to draw some conclusions.

Thank you, Andrius

aparedes commented 6 years ago

There shouldn’t be any AdX stuff in the app. Previously we inserted adx tags as fallback after our Adform placements, but it was removed, so it should be easier to troubleshoot.

The fillrate for the app is going down, while the bid requests are going up. That’s why it can be difficult to find an actual ad in production.

If its easier, we can book some house ads so something is always returned.

andriusmisiunas commented 6 years ago

Yes, please, at least we can take a look what takes the time to render ads.

Thank you!

aparedes commented 6 years ago

Should be on now.

andriusmisiunas commented 6 years ago

Hi,

Sorry for the long delays. We see that the ad (bigger one) which is displayed now every time renders in 2-3 seconds. We are investigating what possible actions may be to improve the rendering - at least if it is something we can control. Will let you know as we progress.

Andrius

andriusmisiunas commented 6 years ago

Short update on findings so far. We have looked into the web calls that the app is making and it seems that they do respond in timely fashion. However we do see that after ADX returns the links to load banner, when they are passed to the webview, it does not call the serving URLs for approximately 2 seconds - and we believe it should account to the delays. We will look more into what is going on in the webview, however it is already outside of the SDK and ad rendering scope - hard to estimate if our investigation will yield some actionable results. If you have the capability, please look into that part as well and share your findings.

Thank you!