react-native-google-mobile-ads
react-native-google-mobile-ads copied to clipboard
[🐛] [Android] Impressions tracking issue
Issue
Hi !
I've noticed issue connected with tracking ad impressions in Android. After showing ad on screen, I can't see request to Google which tells us that ad is being impressed, even onAdImpression
callback isn't fired. Problem refers to banners, because in my app I'm using only GAM Banners (GAMBannerAd component).
What I've noticed, issue can be connected with React Navigation package because when my GAMBannerAd is wrapped by Screen (from React Navigation package), then impression isn't fired (as below)
Same situation is when Ad component is wrapped by SafeAreaProvider (one of package from React Navigation) - i think generally that main problem is connected with SafeAreaView on Android
But if Ad component isn't wrapped by Screen component - everything works well, impression is being tracked correctly
I've also noticed that when Ad is being put inside FlatList and it will show after swipe list - then impression is being tracked correctly. What is important - on iOS there is no problem with it, every ad is being tracked properly.
To be honest, I have no idea what else I can do with it, I hope that anyone had similar problem and has solution :)
Thank You in advance !
Environment
Click To Expand
react-native info
output:
System:
OS: Linux 4.15 Ubuntu 18.04.5 LTS (Bionic Beaver)
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 17.57 GB / 31.29 GB
Shell: 4.4.20 - /bin/bash
Binaries:
Node: 14.17.5 - ~/.nvm/versions/node/v14.17.5/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.14.14 - ~/.nvm/versions/node/v14.17.5/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
Android SDK:
API Levels: 28, 29, 30, 31, 32
Build Tools: 23.0.1, 27.0.3, 28.0.2, 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 32.0.0
System Images: android-24 | Google APIs Intel x86 Atom, android-26 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java: 11.0.8 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.65.1 => 0.65.1
npmGlobalPackages:
*react-native*: Not Found
-
Platform that you're experiencing the issue on:
- [ ] iOS
- [x] Android
- [ ] iOS but have not tested behavior on Android
- [ ] Android but have not tested behavior on iOS
- [ ] Both
-
Are you using
TypeScript
?-
Y
&4.5.5
-
- 👉 Check out
Invertase
on Twitter for updates on the library.
A reproducible example would help - ideally a PR based on the example or a repo forked with changes to the example that add navigation and show the problem along with instructions on how to view it working vs not working ?
Then from there you could see what's going on perhaps. Might have to do with react-native-screens perhaps and use of fragments natively or similar but that is a seriously iffy guess, I have no actual knowledge of the same, just some vague recollection of how navigation maps to native things on android and your mention that ios is good but android is not made me think of it
Hi @mikehardy ! Thank You for response :) Here it's PR with example described in this issue
https://github.com/invertase/react-native-google-mobile-ads/pull/200
I've added onAdImpression
listener and as I've writeen above, after adding React Navigation package onAdImpression
listeren isn't being triggered after launch app (when we'll remove componencts from React Navigation, listener is triggering correctly)
I'll be very grateful for help, because it's very big problem for me. Also I think that lot of users has same issue, but of course it depends on people use impressions counter :)
Thank you for posting the reproduction! I need to set expectations that I'm traveling right now and will be for a couple weeks more so I won't have time personally to look in to it, but now anyone can if they have time - pull the PR and run the example - and with some instrumentation of the native code to log out API calls + their arguments, then any API call returns and the return values we can hopefully get some more information
Thank you @mikehardy ! I'll also try to dig into it myself - of course I'll let you know about results :)
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
Same issue, any new update on this issue? This greatly affects the "show rate" report on the admob page.
Update: I did a little hacking by putting an empty ScrollView and automatically scrolling when onAdLoaded. The show rate on the AdMob page has increased significantly, but it's not perfect for me.