DFP interstitial ad, can not receive app event on android 7.0 device

168 views
Skip to first unread message

jinlon...@smalltreemedia.com

unread,
Nov 2, 2017, 2:15:29 AM11/2/17
to Google Mobile Ads SDK Developers
Hi,
I set up a custom creative in DFP back-end.I'm trying use app event so that I can get a string message when click the interstitial ad. It works well on devices which Android OS version < 7.0;but there has no effect on Android 7.0 or above. Anyone can help me?

Here is my JS code snippet of ad creative:
.....//other js code 

<script>
 function handleClick() {
console.log('dispatchAppEvent---->');
             admob.events.dispatchAppEvent('color', 'green');
return false;
}
</script> 
<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" >
<table cellspacing="0" cellpadding="0" border="0">
<tr><td>
<a href="#" target="_top" onClick="return handleClick()" >
<img id="_admPortraitImage" src="%%FILE:JPG1%%" style="border:0px" />
<img id="_admLandscapeImage" src="%%FILE:JPG2%%" style="border:0px" />
</a>
</td></tr>
</table>
</body>
.....//other js code 

My demo app code like this: mInterstitialAd is an object of PublisherInterstitialAd
mInterstitialAd.setAppEventListener(new AppEventListener() {
@Override
public void onAppEvent(String name, String data) {
Toast.makeText(MyActivity.this,"onAppEvent:name= " +name + " data = "+ data,
Toast.LENGTH_SHORT).show();
}
});

jinlon...@smalltreemedia.com

unread,
Nov 2, 2017, 2:53:54 AM11/2/17
to Google Mobile Ads SDK Developers
google_mobile_app_ads:
<script type="text/javascript" src="//googleads.g.doubleclick.net/mads/static/mad/sdk/native/api/v1/google_mobile_app_ads.js"></script>

Ivan Bautista (Mobile Ads SDK Team)

unread,
Nov 2, 2017, 4:13:28 AM11/2/17
to Google Mobile Ads SDK Developers
Hi,

Thank you for providing to us the code snippets. There's nothing out of the ordinary as far as Mobile Ads SDK code implementation is concerned so it's safe to assume that your SDK implementation is correct given that it is working in some devices. The only difference I noticed between your JS code snippet and the sample JS code is that you are implementing a return onClick.

That said, I tested our sample app (specifically DFPAppEventsFragment.java) and verified that App events are working while testing Banner Ads on 7.0 Android device and a 7.1 Android emulator but not working on our Nexus 5x device (Android 7.1). I will raise this to the rest of the team and verify if this is related to a known issue and get back to you for any official feedback.

In the mean time, to help us narrow down the root cause of your issue, could you share with us privately (using the Reply privately to author option) the Interstitial Ad Unit Id in question as well as the specific affected devices?

Regards,
Ivan Bautista
Mobile Ads SDK Team

jinlon...@smalltreemedia.com

unread,
Nov 2, 2017, 10:06:21 PM11/2/17
to Google Mobile Ads SDK Developers
Hi,
I shared my interstitial ad unit id yesterday,did you get it? and why I can not see my emails replied to you? I'm new in Google Forum.

Ivan Bautista (Mobile Ads SDK Team)

unread,
Nov 3, 2017, 12:19:49 AM11/3/17
to Google Mobile Ads SDK Developers
Hi, 

I sent yesterday a response to your email privately to ask for additional information to further investigate. Those emails and response won't be posted in the Google Mobile Ads SDK public forum, but supposedly should be accessible privately in your email inbox. Kindly check your inbox again to verify.

In that response, I said that I was able to test your Ad Unit Id on our end and was able to request Ad successfully.

We tried to capture Charles logs while testing your Ad Unit Id on our end and verified from the returned Ad Creative's JS code snippet that the name of the app event and the extra data that were passed in the dispatchAppEvent were successfully returned in onAppEvent() on our end when corresponding custom targeting is set, thus, we were able to verify that the App event is being triggered successfully when tested using an Asus Zenphone 3 (Android 7.0) and Nexus 5x (Android 7.1).

That said, this seems to be more of a device specific issue rather than anything specific to your implementation. To help us narrow down the root cause of the issue, would you be able to specify to us the affected devices as well as capture the Charles session (refer here for setup instructions) when issue was encountered in those devices? You may share to us privately the Charles logs using the same Reply privately to author option.

Ivan Bautista (Mobile Ads SDK Team)

unread,
Nov 3, 2017, 5:07:41 AM11/3/17
to Google Mobile Ads SDK Developers
Hi,

Thank you for providing to us privately the captured Charles logs as well as the affected devices. Looking at the JS code snippets of the returned Ad creative in the Charles logs, it seems that the dispatchAppEvent was called since the corresponding if condition that contains it was met.

That said, I tested the same Ad Unit Id and the same Ad Creative (as per your Charles logs) with our Nexus 5x device (7.1.1) and verified that the expected name and data values passed from the dispatchAppEvent in the JS code was successfully returned when onAppEvent was triggered on our test app.

Could you try testing out this modified test app (based from the InterstitialExample app) with your Nexus 5x device and see if the onAppEvent is still not being triggered on your end? In the modified test app, you just need to edit the Ad Unit Id in the setAdUnitId(..) at line 62 of MyActivity class. 

If the below logs appeared in your logcat (or Android Monitor) after clicking the Ad, then you can safely assume that the onAppEvent is working in that device.
com.google.android.gms.example.interstitialexample D/Ads: onAppEvent:name= <THE APP EVENT NAME>, data = <THE EXTRA DATA>
com.google.android.gms.example.interstitialexample I/Ads: JS: dispatchAppEvent---->click 

Ivan Bautista (Mobile Ads SDK Team)

unread,
Nov 3, 2017, 7:02:17 AM11/3/17
to google-adm...@googlegroups.com
Hi,

Thank you for taking the extra effort in doing parallel investigation with us. I will relay all these information you recently provided to the rest of the team and get back to you if I have any official feedback from the team.

Also, could you provide us access to the demo link you provided recently so we can check this as well?

Regards.

jinlon...@smalltreemedia.com

unread,
Nov 3, 2017, 7:10:58 AM11/3/17
to Google Mobile Ads SDK Developers
Hi,
Thanks for your prompt reply . 

jinlon...@smalltreemedia.com

unread,
Nov 5, 2017, 8:16:49 PM11/5/17
to Google Mobile Ads SDK Developers
Hi,
Did you get any update for this issue? My work is being blocked by it. :(

Ivan Bautista (Mobile Ads SDK Team)

unread,
Nov 6, 2017, 2:11:53 AM11/6/17
to Google Mobile Ads SDK Developers
Hi,

Thank you for getting back to us with new set of Charles logs from another device and for providing us access to your demo link. I tested your demo app and was able to load an Ad successfully and App event was triggered successfully based from the captured device logs. I will send to you privately the device logs captured on our end showing that the App Event was successfully triggered on our end for your reference.

Please note that the known issue mentioned earlier is with the AppEvent for Banner Ads but we haven't reproduce the issue yet with Interstitial Ads on our end as you've described. Looking at the JS code snippets of the returned Ad creative in the new Charles logs provided, similar to my observation earlier, it seems that the dispatchAppEvent was called since the corresponding if condition that contains it was met.

There is no official feedback yet from the team regarding the issue but rest assured that they are actively working on this. I will also send another followup with the new details you provided.

Regards,

jinlon...@smalltreemedia.com

unread,
Nov 6, 2017, 2:53:11 AM11/6/17
to Google Mobile Ads SDK Developers
Hi,
Thanks for your reply.
What a confusing problem.In fact,this issue always occurs on some of my devices.

In addition, the issue on Kindlefire(android 4.4.3) what I mentioned before,here are some new info update:
If complied with ads-sdk 10.2.0,it works well(can receive app event successfully):
compile 'com.android.support:appcompat-v7:25.3.1' 
compile 'com.google.android.gms:play-services-ads:10.2.0'
 But if complied with the last ads-sdk 11.4.0,can not receive app event :
compile 'com.android.support:appcompat-v7:26.0.0' 
compile 'com.google.android.gms:play-services-ads:11.4.0'
Could you have a try and see whether it could be reproduced ? 

jinlon...@smalltreemedia.com

unread,
Nov 6, 2017, 3:31:05 AM11/6/17
to Google Mobile Ads SDK Developers
Hi,
The issue seems to be related to local google play services version, I tried like the follow steps on my Nexus5x(Android 7.1.1):
1.disable the google play services( version 11.5.18)
2.enable the google play services(now the version becomes to v9.8.79,I don't know why)
3.launch my test app again and can receive AppEvent successfully now. The ads SDK version I used as follow:
compile 'com.android.support:appcompat-v7:26.0.0' 
compile 'com.google.android.gms:play-services-ads:11.4.0'
But what's the real reason ? and if so, how to make the app event works successfully and easily ?

jinlon...@smalltreemedia.com

unread,
Nov 7, 2017, 2:21:40 AM11/7/17
to Google Mobile Ads SDK Developers
Hi,
Did you get any update of this issue?

Ram Parameswaran (Mobile SDK Team)

unread,
Nov 7, 2017, 3:58:28 PM11/7/17
to Google Mobile Ads SDK Developers
Hi,

We're still having trouble reproducing this issue. I've tried a variety of devices, including the ones you've mentioned, and the AppEvent is always behaving as expected.

- Ram

jinlon...@smalltreemedia.com

unread,
Nov 7, 2017, 8:57:55 PM11/7/17
to Google Mobile Ads SDK Developers
Hi,
Thanks for your reply.
What are the version numbers of the google play services app on your tested devices ?Are they same or could you pls pay more attention about the info of the library on your different device?Because I found if I disabled and then enabled the google play services  by manual in Application manager, the issue was solved.Usually, I followed the steps as below:
1.Enter the Application Manager in Settings to find the google play services;
2.Disable the google play services and will get a dialog,click the "disable app";
3.Then,a new dialog prompts "Replace this app with the factory version?",click "ok";
4.And then, enable the factory version google play services.
5. Test my demo app, App event can be received now.

My Device Info:
Motorola Nexus6 Android7.0

In addition, after replaced the google play services with factory version, I add some code in my demo activity to update the google play services app:

GoogleApiAvailability.getInstance().makeGooglePlayServicesAvailable(this)
 
Now in my test demo app, I can update the google play services app followed the prompt message. The google play services app was updated in Google play store with the recommend version,new version google play services app has no effect on this issue seems to be.The issue never appears again.
 
Could you help to find out the real reason and give me any advise to avoid the issue?

Ram Parameswaran (Mobile SDK Team)

unread,
Nov 8, 2017, 3:19:41 PM11/8/17
to Google Mobile Ads SDK Developers
We are having trouble reproducing this issue with the latest version of Google Play services installed on device. In our testing, app events work without issue across the devices you mentioned without having to revert to the factory installed version of Google Play services.

- Ram
Reply all
Reply to author
Forward
0 new messages