AppLovin / AppLovin-MAX-Unity-Plugin

126 stars 34 forks source link

OnAdReceivedRewardEvent called with empty placement id #228

Open dhamelin opened 1 year ago

dhamelin commented 1 year ago

MAX Plugin Version

5.6.7

Unity Version

2021.3.13

Device/Platform Info

Android

Current Behavior

My game logs report that, sometime, MaxSdkCallbacks.Rewarded.OnAdReceivedRewardEvent is called with an empty placement value (from AdInfo.Placement)

Expected Behavior

No response

How to Reproduce

Unfortunately I can't reproduce the issue.

I have 8 placements, defined in a enum. So empty placement isn't normal at all.

In the advanced reporting, for yesterday, I had 5653 impressions spread in these 8 placements. I'm pretty confident about the code. I'm also seeing an empty placement name with 20 impressions (probably related?)

I have updated the game's log to have more information and I can say that it had happened with at least the AppLovin, Facebook and APPLOVIN_EXCHANGE network.

Additional Info

My account's email is dhamelin at gmail

JonathanLiuApp commented 1 year ago

Hi @dhamelin is it possible that the placement of some ads were set after the ad was loaded? If this happened, it would cause ads to not be correctly attributed to the placement, possibly causing an empty placement value.

dhamelin commented 1 year ago

Hi @JonathanLiuApp, in fact all my placements are set after ad loading. I only set the placement at the time of showing the video with MaxSdk.ShowRewardedAd(adUnitId, placementId)

I'm not sure how can I do it differently since MaxSdk.LoadRewardedAd doesn't have a "placement" param.

I have only one ad unit, which I try to always kept loaded (cached) and ready to be shown upon request. I load it when the app boots, when an ad failed to show or when an ad gets hidden. My understanding was that the ad doesn't have a placement assign until I try to display it.

I haven't checked the order of events, but maybe re-loading the ad upon an OnAdHiddenEvent is too soon, especially if the OnAdReceivedRewardEvent isn't received yet?

JonathanLiuApp commented 1 year ago

@dhamelin Would you be able to send us your verbose logs, so we can see what is happening? https://dash.applovin.com/documentation/mediation/unity/getting-started/advanced-settings#enable-verbose-logging

dhamelin commented 1 year ago

Here's the log from boot to watch ad

app-lovin-MAX-verbose.txt

(Reminder that I can't reproduce the issue)

JonathanLiuApp commented 1 year ago

Thanks! Also, did this happen only on Android, or did you see this issue on iOS as well?

dhamelin commented 1 year ago

Our iOS app isn't using MAX mediation yet, so I can't tell for sure.

JonathanLiuApp commented 1 year ago

Does this only happen for rewarded ads, or does this happen for other formats as well? Also, would you be able to send us the integration code around showing the rewarded ads? We took a look at the logs and our code, but we weren’t able to find any way the empty placements could have happened.

dhamelin commented 1 year ago

We only have rewarded ads in the game.

And sure, here's my class that handle the SDK implementation:

GameAppLovin.cs.txt

I'm seeing the LogError in OnRewardedAdReceivedRewardEvent()

Here's some examples:

Failed to give Ad reward because placement id is null network: Facebook MaxSdkCallbacks:InvokeEvent(Action`3, T1, T2, T3, String)

Failed to give Ad reward because placement id is null network: AppLovin MaxSdkCallbacks:InvokeEvent(Action`3, T1, T2, T3, String)

Failed to give Ad reward because placement id is null network: APPLOVIN_EXCHANGE MaxSdkCallbacks:InvokeEvent(Action`3, T1, T2, T3, String)

Failed to give Ad reward because placement id is null System.Action`3:Invoke(T1, T2, T3) MaxSdkCallbacks:InvokeEvent(Action`3, T1, T2, T3, String) MaxSdkCallbacks:ForwardEvent(String)
soqman commented 9 months ago

Did you manage to solve the problem? I started having this problem more often when we introduced an additional adUnitId and started showing ads more often.

soqman commented 9 months ago

Hi @dhamelin is it possible that the placement of some ads were set after the ad was loaded? If this happened, it would cause ads to not be correctly attributed to the placement, possibly causing an empty placement value.

I understand that the OnAdLoadedEvent event may come without the placement parameter because it has not been set yet, but the events after the start of the ad display should not depend on it, right?

dhamelin commented 9 months ago

Hi @dhamelin is it possible that the placement of some ads were set after the ad was loaded? If this happened, it would cause ads to not be correctly attributed to the placement, possibly causing an empty placement value.

I understand that the OnAdLoadedEvent event may come without the placement parameter because it has not been set yet, but the events after the start of the ad display should not depend on it, right?

I forgot a bit about that. But I'm seeing a lot less "no-name" placement id now. Like 1 per month, instead of 200 for the whole month of Feb. 2023. I don't recall taking a particular action to improve that, sorry.

soqman commented 9 months ago

thansk for your response