Using custom template callback on content / app install native ads

241 views
Skip to first unread message

Thomas M

unread,
Apr 12, 2016, 3:47:15 AM4/12/16
to Google Mobile Ads SDK Developers
Hello everyone.

I'm trying to integrate native ads using the custom template formats.

I'm registering the listener for both the temlpate ids 10004520 (Content Ad) and 10004400 (App Install Ad) but I am getting no fill using the native ad test id "/6499/example/native".
However if I'm also adding the test template ID of 10063170, I'm receiving only native ads for this id.

Is it possible to receive the default content ads and app install ads with the OnCustomTemplateAdLoadedListener?

Thanks in advance,
Thomas

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Apr 12, 2016, 9:39:40 AM4/12/16
to Google Mobile Ads SDK Developers
Hi Thomas,

The "/6499/example/native" Ad Unit ID is only for testing and if you for using Custom Native Ads, you would need to generate both your own Ad Unit ID and a Custom Template ID. If you use your Template ID and our Ad Unit ID, you would not receive any ads. Do note that a Template ID is only required for Custom Native Ads. The other two - Native App Install Ad and Native Content Ad View does not require Template ID but still would need an Ad Unit ID. Also, you can use a single AdLoader with one Ad Unit ID if you have an Ad Unit ID that is configured to serve across multiple ad formats. 

Thanks,
Veer Busani
Mobile Ads SDK Team

Thomas M

unread,
Apr 12, 2016, 9:55:38 AM4/12/16
to Google Mobile Ads SDK Developers
Thanks for your reply.

This is a quote of the google documentation for the test id "/6499/example/native":
"It's configured to serve sample app install and content ads, as well as a custom native ad format with the following assets..."

So I'm assuming it also delivers content and app install ads. If it does not serve them, the documentation should be adjusted.


I cannot use the default callbacks for native content and app install ad since those require the use of special ViewGroups in my layout which is not possible.
That's why I am trying to receive those system defined creatives via their template id. This is a snippet of my code:

AdLoader adLoader = new AdLoader.Builder(adContainer.getContext(), adTag.tag)
.forCustomTemplateAd("10004520",
new DfpNativeContentAdDataAdapter(adContainer, mediationCallback), null)
.forCustomTemplateAd("10004400",
new DfpNativeAppInstallAdDataAdapter(adContainer, mediationCallback), null)
.withAdListener(new AdListener() {
@Override
public void onAdFailedToLoad(int errorCode) {
mediationCallback.onAdFailed();
}
})
.withNativeAdOptions(new NativeAdOptions.Builder()
.setReturnUrlsForImageAssets(true)
.build())
.build();

But for every request on the test ID I'm receiving no fill.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Apr 12, 2016, 10:40:39 AM4/12/16
to Google Mobile Ads SDK Developers
Hi Thomas,

You would be able to use our test Ad Unit ID /6499/example/native for all the three - Native App Install Ad, Native Content Ad and Native Custom Ad. To test Custom Ad, you would also have to use our sample Template ID: 10063170. The code snippet that you have provided does not seem properly done. I would suggest you to look at our Native sample app example for proper implementation. You could also send us a sample app that would replicate the issue.

Thanks,
Veer Busani
Mobile Ads SDK Team

Thomas M

unread,
Apr 13, 2016, 4:10:01 AM4/13/16
to Google Mobile Ads SDK Developers
Hi Veer.

I think we have a misunderstanding here.
As stated in the subject, I do want to receive the system defied native ads via their template format id using the custom receiver.
Meaning I do not want it to do like in the example project because that would require for me to use the "NativeContentAdView" classes inside my layouts which is not possible.
As you can see in the following screenshot, I'm receiving the template IDs 10004400 and 10004520 for the respectinve native ad format.
And based on the code in my previous answer you can see that I'm using the custom format listener to receive those formats.


Is this approach possible or are we forced to use the NativeContentAdView classes inside our layouts with system defined formats?


Best regards,

Thomas

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Apr 13, 2016, 10:28:00 AM4/13/16
to Google Mobile Ads SDK Developers
Hi Thomas,

I finally understand what you are trying to achieve here :) But currently this would not be possible as the SDK would not be able to render this is via the Custom Native Ad class. You would need to use their respective NativeAppInstallAd and NativeContentAd for this.

Thanks,
Veer Busani
Mobile Ads SDK Team

Thomas M

unread,
Apr 13, 2016, 10:49:03 AM4/13/16
to Google Mobile Ads SDK Developers
Hi Veer.

Thanks for the clarification.
Its sad that this is not supported since this makes integrating DFP alongside other native ad frameworks a lot more complicated.
No other framework I've come across requires specific View classes to be used.

Best regards,
Thomas

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Apr 14, 2016, 3:02:02 PM4/14/16
to Google Mobile Ads SDK Developers
Hi Thomas,

My apologies for the confusion. It is possible for a unified Multi-formatted Native Ads request all at once. I would suggest you to look at our Native sample app, particularly this class to understand how this is done. Do let us know if you need anything else.

Thanks,
Veer Busani
Mobile Ads SDK Team

Boy Lenssen

unread,
Jan 4, 2018, 4:59:02 AM1/4/18
to Google Mobile Ads SDK Developers
all your links are dead-ends atm :(

Deepika Uragayala- MobileAds SDK team

unread,
Jan 4, 2018, 3:03:25 PM1/4/18
to Google Mobile Ads SDK Developers
Hi Lenssen,

We would suggest that you open a new thread with complete details about your issue and we will assist you based on the information you provide. Moving forward, please avoid reopening old threads as it gets harder for us and other users to track your questions and responses. Feel free to open a new thread and we will be happy to assist you.

Regards,
Deepika Uragayala
Mobile Ads SDK Team
Reply all
Reply to author
Forward
0 new messages