Native ads: accessing click-through URL in GADNativeCustomTemplateAd's custom click handler

2,372 views
Skip to first unread message

Y. Fan

unread,
Aug 8, 2016, 6:12:56 PM8/8/16
to Google Mobile Ads SDK Developers
We're using GADNativeCustomTemplateAd and would like to sometimes use a custom click handler so that we could open the click-through URL in our own web view controller inside the app, instead of opening it in Safari. We're hoping to make use of this click-through URL from the customClickHandler passed to performClickOnAssetWithKey:customClickHandler: as described in https://developers.google.com/mobile-ads-sdk/docs/dfp/ios/native#handling_custom_native_ad_format_clicks_and_impressions.

However, we haven't found any way to get the click-through/Deeplink/Destination URL. If passing in a non-nil customClickHandler, is there any way to get access to the click-through URL? The ad format page doesn't list a Variable ID for Click-through URL.

Based on the following similar question for Android, it seems we'd need to add a new variable as a workaround. Can you confirm that this is true for iOS as well?

https://groups.google.com/forum/#!searchin/google-admob-ads-sdk/native%7Csort:relevance/google-admob-ads-sdk/fYjoqShfd8g/8fI2QWiOAAAJ

A related question -- in the iOS docs above, is Deeplink/Destination URL the same as Click-through URL?

Thanks!

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Aug 9, 2016, 10:46:43 AM8/9/16
to Google Mobile Ads SDK Developers
Hi there,

The issue with the Click-through URL variable, in your creative setup, is that it would not have any Variable ID. Without this, you would not be able to know the Click-through URL of your Custom Native ad. The workaround for this would be to make a duplicate URL variable, which would have a Variable ID, and use the SDK's performClickOnAssetWithKey method to do a custom click for your AdView. So, the resolution would be the same irrespective of the platform.

Also, a Deeplink URL is something different, which is used to load up a different app within the device. The SDK would try to look for this URL to invoke if a custom click is not implemented. If neither a custom click nor a Deeplink URL is available, it would then fallback to the traditional Click-through URL. 

Do let us know if you need anything else. You can also learn more about Custom Native templates and URL variables here.

Thanks,
Veer Busani
Mobile Ads SDK Team

Y. Fan

unread,
Aug 9, 2016, 11:17:06 AM8/9/16
to Google Mobile Ads SDK Developers
Thanks for the reply and the explanation, Veer. We appreciate your help!

西山修

unread,
Aug 23, 2016, 9:46:07 AM8/23/16
to Google Mobile Ads SDK Developers
Hi Veer Arjun Busani(Mobile Ads SDK Team) ,

I had a problem in using GADNativeCustomTemplateAd. I understand it can't access Click-through URL on GADNativeCustomTemplateAd. My Custom Native ad template is set variable a same URL for "My link URL" and "Click-through URL". My app call performClickOnAssetWithKey method and open WebView with "My link URL" in customClickHandler. But this case occurred twice requests, the performClickOnAssetWithKey method request to Click-through URL silently.

How can I prevent the request of Click-through URL? My solution is that Click-through URL is set dummy url. Let me know if you had any idea.

Thanks.

2016年8月9日火曜日 23時46分43秒 UTC+9 Veer Arjun Busani(Mobile Ads SDK Team):

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Aug 23, 2016, 10:00:43 AM8/23/16
to Google Mobile Ads SDK Developers
Hi there,

If you have implemented a customClickHandler  then the SDK would not call the default Click-through URL. If you do not have any custom click handler, then the SDK would waterfall to any available deep links for the custom native template. If there is none, then the last step would be to invoke the default Click-through URL. 

So if you have implemented customClickHandler then there would not be any further requests. You can read more about this in our documentation.

Thanks,
Veer Busani
Mobile Ads SDK Team

西山修

unread,
Aug 23, 2016, 10:52:52 AM8/23/16
to Google Mobile Ads SDK Developers
Thank you quick response!

You said no, but My App occurred to request the default Click-through URL silently. My SDK version is Google-Mobile-Ads-SDK (7.8.1). I set ad template like as My link URL is https://aaaaa.com, and Click-through URL is https://bbbbb.com. Then I tapped custom ad, it run request https://aaaaa.com with webview, and dfp redirect url then redirect to https://bbbbb.com on background.

I will re-debug my app, try to update SDK, and I'll debug googleads-mobile-ios-examples. If still there is no resolution, I'll ask you again. Anyway, thank you.

西山修

unread,
Aug 23, 2016, 9:51:30 PM8/23/16
to Google Mobile Ads SDK Developers
Hello again.

I found two difference between my app and DFPCustomRenderingExample. My app request by DFPRequest() with customTargeting, but DFPCustomRenderingExample request by GADRequest().
I debuged HTTP request on mitmproxy, After performClickOnAssetWithKey, My app request "https://adclick.g.doubleclick.net/pcs/click?too_long_params&adurl=https://click-through-url.com" and 302 redirect to "https://click-through-url.com", but DFPCustomRenderingExample request "https://adclick.g.doubleclick.net/pcs/click?too_long_params&adurl=" and 200 OK, so adurl was empty.

I tried customize GADRequest to DFPRequest on DFPCustomRenderingExample, and provided my dfp ads. The result was same.

Is there bugs on Google Mobile Ads API? Please check this situation.

西山修

unread,
Aug 23, 2016, 10:11:24 PM8/23/16
to Google Mobile Ads SDK Developers
Sorry again.

This problem may be cause by my DFP ads creative settings. I wish I set empty on click-through URL, but click-through URL is required. Is there any idea?

Thanks.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Aug 24, 2016, 10:26:03 AM8/24/16
to Google Mobile Ads SDK Developers
Hi there,

A Click-through URL is a required field and you cannot leave it empty. You can read more about Custom Native format fields here. If you don't have a valid URL, then this would be the likely outcome. Don't leave the Click-through URL empty and try again.

Let us know if you need anything else.

Thanks,
Arjun Busani
Mobile Ads SDK Team

Rishiraj Kalra

unread,
Sep 26, 2016, 7:37:18 AM9/26/16
to Google Mobile Ads SDK Developers
Hey Arjun,

Need some urgent help regarding DFP ads... We are using DFP to serve ads on our app. We are using native ad format with custom DeeplinkURL... It was working perfectly when we did a POC and until few days back.. but now suddenly the app seems to ignore DEEPLINK Action URLS and falls back to Click Through URL even when Deeplink exists.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Sep 26, 2016, 10:26:14 AM9/26/16
to Google Mobile Ads SDK Developers
Hi Rishiraj,

Can you send us your Line Item, Creative and the Ad Unit ID? Also, before you do that, make sure that you are able to reproduce the issue with our sample app. It might be due to your implementation.

Thanks,
Arjun Busani
Mobile Ads SDK Team

Rishiraj Kalra

unread,
Sep 27, 2016, 1:15:52 AM9/27/16
to google-adm...@googlegroups.com
Hey Arjun,

Can you share a sample Android APP ?... 
Ad Unit Id: /67416580/ANDROID_HOME_ATF_NATIVE_330x80
We are using a native creative... How can I share the line Item and Creative ? .. should I share the details ?

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/SXxDKzlyH8g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--


Thanks and Regards
Rishiraj K
Associate Product Manager
1mg

Rishiraj Kalra

unread,
Sep 27, 2016, 3:16:06 AM9/27/16
to google-adm...@googlegroups.com, Kshitij Kumar
Hey Arjun,

We tried to use the sample app for android from the same repository above. The issue is 100% reproducible, the ad seems to ignore the Deeplink URL even though we have set it up and directly falls back to Click through URL.. Please advice a solution. also let me know if you need anything else. 

On Tue, Sep 27, 2016 at 10:45 AM, Rishiraj Kalra <rishira...@1mg.com> wrote:
Hey Arjun,

Can you share a sample Android APP ?... 
Ad Unit Id: /67416580/ANDROID_HOME_ATF_NATIVE_330x80
We are using a native creative... How can I share the line Item and Creative ? .. should I share the details ?
On Mon, Sep 26, 2016 at 7:56 PM, 'Veer Arjun Busani(Mobile Ads SDK Team)' via Google Mobile Ads SDK Developers <google-admob-ads-sdk@googlegroups.com> wrote:
Hi Rishiraj,

Can you send us your Line Item, Creative and the Ad Unit ID? Also, before you do that, make sure that you are able to reproduce the issue with our sample app. It might be due to your implementation.

Thanks,
Arjun Busani
Mobile Ads SDK Team

On Monday, September 26, 2016 at 7:37:18 AM UTC-4, Rishiraj Kalra wrote:
Hey Arjun,

Need some urgent help regarding DFP ads... We are using DFP to serve ads on our app. We are using native ad format with custom DeeplinkURL... It was working perfectly when we did a POC and until few days back.. but now suddenly the app seems to ignore DEEPLINK Action URLS and falls back to Click Through URL even when Deeplink exists.

On Wednesday, August 24, 2016 at 7:56:03 PM UTC+5:30, Veer Arjun Busani(Mobile Ads SDK Team) wrote:
Hi there,

A Click-through URL is a required field and you cannot leave it empty. You can read more about Custom Native format fields here. If you don't have a valid URL, then this would be the likely outcome. Don't leave the Click-through URL empty and try again.

Let us know if you need anything else.

Thanks,
Arjun Busani
Mobile Ads SDK Team

On Tuesday, August 23, 2016 at 10:11:24 PM UTC-4, 西山修 wrote:
Sorry again.

This problem may be cause by my DFP ads creative settings. I wish I set empty on click-through URL, but click-through URL is required. Is there any idea?

Thanks.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/SXxDKzlyH8g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--


Thanks and Regards
Rishiraj K
Associate Product Manager
1mg

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Sep 27, 2016, 11:39:31 AM9/27/16
to Google Mobile Ads SDK Developers, kshiti...@1mg.com
Hi Rishiraj,

Can you confirm me whether you are using 1mg://www.1mg.com/all_articles as your deep link? I'm not sure whether that is your valid URL. I would suggest you check again and maybe test with a global Deep Link URL such as tel:203013930 and try again. This would confirm whether the issue is the URL pattern or with the SDK itself.

Thanks,
Arjun Busani
Mobile Ads SDK Team

To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--


Thanks and Regards
Rishiraj K
Associate Product Manager
1mg

Rishiraj Kalra

unread,
Sep 27, 2016, 12:36:02 PM9/27/16
to google-adm...@googlegroups.com, Kshitij Kumar, Kuldeep Tomer

Hi Veer (on behalf of Kshitij),

Yes, we are using 1mg://www.1mg.com/all_articles as deeplink URL. This is correct URL, and our Android app listens for URL starting with custom '1mg' scheme. We have defined appropriate intent filters for such URLs.

This worked just fine few days back. But surprisingly this has stopped working now with no code change in our Android app. 


To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--


Thanks and Regards
Rishiraj K
Associate Product Manager
1mg



--


Thanks and Regards
Rishiraj K
Associate Product Manager
1mg

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/SXxDKzlyH8g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Sep 27, 2016, 12:53:59 PM9/27/16
to Google Mobile Ads SDK Developers, kshiti...@1mg.com, kuldee...@1mg.com
Hi guys,

Thanks for confirming. But since I would not be able to reproduce, can you create a native template with a Deep Link URL pointing to a global scheme such as tel:19483939292 and try again? Also send me that Ad Unit ID to debug. Also, have you changed any versions of late? And please confirm me the SDK version as well.

Thanks,
Arjun Busani
Mobile Ads SDK Team

On Tuesday, September 27, 2016 at 12:36:02 PM UTC-4, Rishiraj Kalra wrote:

Hi Veer (on behalf of Kshitij),

Yes, we are using 1mg://www.1mg.com/all_articles as deeplink URL. This is correct URL, and our Android app listens for URL starting with custom '1mg' scheme. We have defined appropriate intent filters for such URLs.

This worked just fine few days back. But surprisingly this has stopped working now with no code change in our Android app. 

Rishiraj Kalra

unread,
Sep 28, 2016, 7:06:49 AM9/28/16
to google-adm...@googlegroups.com, Kshitij Kumar, Kuldeep Tomer
Hi Veer,

It seems to work with the tel: Deeplink, but doesn't work with our own scheme.
We also tried a couple other alternatives such as this -  android-app://{package_id}/{scheme}/{host_path}. Example in your case the url should look like - 

android-app://com.aranoah.healthkart.plus/www.1mg.com/prescription_order

ad unit with Tel: deeplink : /67416580/ANDROID_HOME_ATF_NATIVE_330x80
ad unit with alternative scheme : /67416580/ANDROID_PRODUCT_DRUG_ATF_NATIVE_320x50

Have you changed any versions of late? - NO
SDK version - 9.0.2

To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--


Thanks and Regards
Rishiraj K
Associate Product Manager
1mg



--


Thanks and Regards
Rishiraj K
Associate Product Manager
1mg

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/SXxDKzlyH8g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--


Thanks and Regards
Rishiraj K
Associate Product Manager
1mg

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/SXxDKzlyH8g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Sep 28, 2016, 5:31:16 PM9/28/16
to Google Mobile Ads SDK Developers, kshiti...@1mg.com, kuldee...@1mg.com
Hi Rishiraj,

Can you confirm whether the SDK is able to open the android-app:// schema of your app from the web browser? This sounds like something that would work instead of trying to open your own app's schema when the app is already open.

Thanks,
Arjun Busani
Mobile Ads SDK Team

On Wednesday, September 28, 2016 at 7:06:49 AM UTC-4, Rishiraj Kalra wrote:
Hi Veer,

It seems to work with the tel: Deeplink, but doesn't work with our own scheme.
We also tried a couple other alternatives such as this -  android-app://{package_id}/{scheme}/{host_path}. Example in your case the url should look like - 

android-app://com.aranoah.healthkart.plus/www.1mg.com/prescription_order

ad unit with Tel: deeplink : /67416580/ANDROID_HOME_ATF_NATIVE_330x80
ad unit with alternative scheme : /67416580/ANDROID_PRODUCT_DRUG_ATF_NATIVE_320x50

Have you changed any versions of late? - NO
SDK version - 9.0.2

Jason Raffi

unread,
Oct 31, 2016, 11:05:05 AM10/31/16
to Google Mobile Ads SDK Developers, kshiti...@1mg.com, kuldee...@1mg.com
Any resolution for this? I am having the same issue. It's like it just suddenly stopped trying to process deep links.


On Wednesday, September 28, 2016 at 5:31:16 PM UTC-4, Veer Arjun Busani(Mobile Ads SDK Team) wrote:
Hi Rishiraj,

Can you confirm whether the SDK is able to open the android-app:// schema of your app from the web browser? This sounds like something that would work instead of trying to open your own app's schema when the app is already open.

Thanks,
Arjun Busani
Mobile Ads SDK Team

On Wednesday, September 28, 2016 at 7:06:49 AM UTC-4, Rishiraj Kalra wrote:
Hi Veer,

It seems to work with the tel: Deeplink, but doesn't work with our own scheme.
We also tried a couple other alternatives such as this -  android-app://{package_id}/{scheme}/{host_path}. Example in your case the url should look like - 

android-app://com.aranoah.healthkart.plus/www.1mg.com/prescription_order

ad unit with Tel: deeplink : /67416580/ANDROID_HOME_ATF_NATIVE_330x80
ad unit with alternative scheme : /67416580/ANDROID_PRODUCT_DRUG_ATF_NATIVE_320x50

Have you changed any versions of late? - NO
SDK version - 9.0.2
To post to this group, send email to google-adm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--


Thanks and Regards
Rishiraj K
Associate Product Manager
1mg



--


Thanks and Regards
Rishiraj K
Associate Product Manager
1mg

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/SXxDKzlyH8g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--


Thanks and Regards
Rishiraj K
Associate Product Manager
1mg

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/SXxDKzlyH8g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Oct 31, 2016, 4:46:38 PM10/31/16
to Google Mobile Ads SDK Developers, kshiti...@1mg.com, kuldee...@1mg.com
Hi Jason,

Can you confirm the date from which this has started happening along with your Play Services version? Also, send us Charles session logs of your AdRequest and response and we will have a look into it.

Thanks,
Arjun Busani
Mobile Ads SDK Team

mmccl...@twobitlabs.com

unread,
Nov 1, 2016, 8:44:57 AM11/1/16
to Google Mobile Ads SDK Developers, kshiti...@1mg.com, kuldee...@1mg.com
We're seeing the same thing -- deep links just suddenly stopped working on Android. The exact same ads work fine on iOS. In both cases, we have custom native ad rendering, and we rely on the built-in click handler. I believe this was seen with Play Services 9.4.0. I'll provide additional info as soon as I can.

Jason Raffi

unread,
Nov 1, 2016, 1:22:57 PM11/1/16
to Google Mobile Ads SDK Developers, kshiti...@1mg.com, kuldee...@1mg.com
Running 9.4.0 have gone back as 8.4.0 to reproduce but it used to work fine and just stopped. Sept 24th is when we first noticed the problem.

ad request/response attached.
deeplink_charles.txt

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Nov 1, 2016, 2:32:25 PM11/1/16
to Google Mobile Ads SDK Developers, kshiti...@1mg.com, kuldee...@1mg.com
Hi guys,

I have shared this with the team and we will update you shortly.

Thanks,
Arjun Busani
Mobile Ads SDK Team

Jason Raffi

unread,
Nov 8, 2016, 10:15:17 AM11/8/16
to Google Mobile Ads SDK Developers, kshiti...@1mg.com, kuldee...@1mg.com
any updates?

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Nov 8, 2016, 11:35:09 AM11/8/16
to Google Mobile Ads SDK Developers, kshiti...@1mg.com, kuldee...@1mg.com
Hi Jason,

I still do not have any updated. I will let you know as soon as I have any. For now, I would suggest you to use load Chrome to again ping your app's deeplink url.

Thanks,
Arjun Busani
Mobile Ads SDK Team

Message has been deleted

mmccl...@twobitlabs.com

unread,
Jan 16, 2017, 11:10:15 PM1/16/17
to Google Mobile Ads SDK Developers
Has this issue been addressed? Does anyone know if deeplink URLs work when the android-app:// scheme is used?

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jan 17, 2017, 10:56:07 AM1/17/17
to Google Mobile Ads SDK Developers
Hi there,

I still do not have any update on this. I have again requested for more info from the team and I will share as soon as I have more info.

Thanks,
Arjun Busani
Mobile Ads SDK Team

Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Feb 1, 2017, 9:50:12 AM2/1/17
to Google Mobile Ads SDK Developers
Hi guys,

Just as a confirmation, this has been fixed on the server side and you don't need to update anything from the client end. Let us know if you are still facing this issue.

Thanks,
Arjun Busani
Mobile Ads SDK Team

On Monday, January 16, 2017 at 11:10:15 PM UTC-5, mmccl...@twobitlabs.com wrote:
Reply all
Reply to author
Forward
0 new messages