sbugert / react-native-admob

A react-native component for Google AdMob banners
BSD 2-Clause "Simplified" License
1.13k stars 532 forks source link

Too many Ads Requests! #525

Open omrip2 opened 4 years ago

omrip2 commented 4 years ago

Recently I updated my webview app on the appstore and playstore with a new react-native app, after releasing the application to small percentages of users I have seen that too many requests are being sent to admob. Does anyone know what may be the issues or is there a way to debug admob's requests.

bethea28 commented 3 years ago

Any thoughts on this issue? My team and I are facing similar issue!

rahul-budhia commented 3 years ago

Facing same problem. This can potentially lead to your traffic being qualified as invalid by Admob. The problem is worse on Android.

bethea28 commented 3 years ago

What I discovered was that when the validAdSize property is being used, multiple ad request were being made and it was evident in the adViewDidReceiveAd function as the number of times logs happened in this function matched with the number of ad request present in Charles proxy. So overall I had to bypass using the validAdSize property.

mikejsdev commented 3 years ago

I am having this exact same issue! I am using expo (which uses this package) and the following code. Logging out onAdViewDidReceiveAd shows three ad requests go out each time the screen is rendered. I too have received a warning from Google.

                <AdMobBanner
                    bannerSize="fullBanner"
                    adUnitID='valid test id' // Test ID, Replace with your-admob-unit-id
                    servePersonalizedAds // true or false
                    onDidFailToReceiveAdWithError={this.bannerError}
                    onAdViewDidReceiveAd={this.adRecieved} />

@bethea28 can you let us know how you fixed this? What do you mean by bypass validAdSize? Do you mean you left this property off entirely? Thanks for any help you can give.

youngminz commented 3 years ago

@mikejsdev Have you solved the issue? If so, how did you do it? When I tested it on my iOS and Android devices, I found that using PublisherBanner instead of AdMobBanner mitigates the problem. I'm analyzing the source code to see why changing components alleviates the problem, and there are no other side effects. Interesting...

-                <AdMobBanner
+                <PublisherBanner
                    bannerSize="fullBanner"
                    adUnitID='valid test id' // Test ID, Replace with your-admob-unit-id
                    servePersonalizedAds // true or false
                    onDidFailToReceiveAdWithError={this.bannerError}
                    onAdViewDidReceiveAd={this.adRecieved} />
bethea28 commented 3 years ago

I upgraded to 2.0.0.beta.6 and it solved because it has the pod spec! But it may break android so to fix that I had to change the gm.ads implementation from + to an actual value 19.8.0 in the settings.Gradle. To do so I had to create and fork and change which I didn’t want to do but allowed for auto linking to work. The other option that worked was manual linking which I dropped and dragged All of the banners into the correct Xcode target. Do you have any cleaner solutions ? On Tue, Apr 13, 2021 at 12:40 PM Youngmin Koo @.***> wrote:

@mikejsdev https://github.com/mikejsdev Have you solved the issue? If so, how did you do it? When I tested it on my iOS and Android devices, I found that using PublisherBanner instead of AdMobBanner relieves the problem. I'm analyzing the source code to see why changing components alleviates the problem, and there are no other side effects. Interesting...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sbugert/react-native-admob/issues/525#issuecomment-818880800, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEU7NA5BJCQBXVZRZDH52ILTIRXZHANCNFSM4OG2GGRA .

--

Bryan Bethea Founder | Hip Hop Hacktivist http://bit.ly/2BCWiH2

https://youtu.be/t_xL79c5v28 www.hiphophacktivist.com http://econ.st/2vGSizr http://bit.ly/2sZBl4e

http://bit.ly/2ssCMrT http://bit.ly/2rsjjVn www.woodymoth.com

This electronic message is confidential and is intended only for the use of the individual to whom it is addressed. The information may also be legally privileged. This transmission is sent in trust, for the sole purpose of delivery to the intended recipient. If you have received this transmission in error, you are hereby notified that any use, dissemination, distribution or reproduction of this transmission is strictly prohibited. If you are not the intended recipient, please immediately notify the sender and delete the message from your system.

youngminz commented 3 years ago

I'm building an app using the Expo platform, where native dependency versions cannot be changed, so I'm not thinking about forking and modifying this library right now. Unfortunately, all I can (and can tell) is to keep the current version of the dependency and mitigate that issue as much as possible. Anyway, thanks for the clue that it could be fixed by updating the version of the Google Ads Library. I'll look a little more at the source code level, but I'm not sure if it's possible to find the exact cause. :)