Simulating clicks with Raycast on a Unity Native Ad.

151 views
Skip to first unread message

Xavi Giralt

unread,
Nov 25, 2022, 5:39:21 PM11/25/22
to Google Mobile Ads SDK Developers
Hello guys,

It is my understanding that in Unity, Native Ads only work while inside a "Screen Space - Camera" canvas.

Sadly, my whole game's UI is already in place and it's all in Overlay canvases, which they will always be rendered on top of anything else. You cannot combine them with Screen Space canvases in the same screen.

The only thing that occurs to me, is to have a Screen Space - Camera canvas with the Native Ad being rendered offscreen, and then a "Fake/Duplicate" of the visuals of the Ad inside an overlay canvas, and using Raycast, capture the click on the overlay canvas element and then simulate it on the real ad that is offscreen. However, that doesnt seem to work, as the ad is not fired this way.   
 
To simplify the problem, for now, as a sample project, I have only a Screen Space - Camera canvas with the ad in it and one button that says "Simulate Click".  On device, you can click the Ad directly and it all works fine. But when you click the "Simulate Click button", which performs a Raycast to the position of the Ad, nothing happens.   

Am I missing something here? Do you think this approach should work?  Is the Admob SDK capturing the click in a special way so that the raycast will not trigger the same behaviour?

Thank you very much for your help!




Mobile Ads SDK Forum Advisor

unread,
Nov 28, 2022, 3:47:36 AM11/28/22
to xa...@socialmatchplay.com, google-adm...@googlegroups.com

Hi Xavi,

 

Thank you for reaching out to us.

 

Before we can provide guidance for your concern, can you provide us privately the following details below so that we can have a better visualization to your expected behavior? You can provide the following details via reply privately to author option or directly provide it to the link below.

 

  • Sample app project
  • Steps to replicate
  • SDK version
  • Screen recording of the behavior

 

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

 

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002gfPpuQAE&entry.80707362=00158351

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

 

Regards,

Google Logo
Princess Pamela
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2gfPpu:ref

Xavi Giralt

unread,
Nov 28, 2022, 5:14:11 AM11/28/22
to Google Mobile Ads SDK Developers
Hey guys,

Just uploaded the info you need. Thank you very much! Let me know if you need more help!

Mobile Ads SDK Forum Advisor

unread,
Nov 28, 2022, 3:48:33 PM11/28/22
to xa...@socialmatchplay.com, google-adm...@googlegroups.com
Hi Xavi,

Thank you for getting back to us. As per checking in your file, I could see that it is archive in rar file which I'm afraid that we cannot extract on our end. Could you please upload the project file once again using zip instead?

Regards,
Google Logo
Teejay Wennie
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2gfPpu:ref

Xavi Giralt

unread,
Nov 28, 2022, 5:03:13 PM11/28/22
to Google Mobile Ads SDK Developers
Done. Thank you guys!

Mobile Ads SDK Forum Advisor

unread,
Nov 29, 2022, 4:25:42 AM11/29/22
to xa...@socialmatchplay.com, google-adm...@googlegroups.com

Hi Xavi,

 

Thank you for providing the requested details. However, upon checking it in our end, I wasn't able to replicate the behavior you reported, as I was able to encounter ad failed to load 3. With that, can you provide us a screen recording on how you're replicating this behavior and how the Raycast is working in your sample app project? You can provide the following details via reply privately to author option or directly provide it to the link below.

 

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

 

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002gfPpuQAE&entry.80707362=00158351

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

 

Regards,

Google Logo
Princess Pamela
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2gfPpu:ref

Xavi Giralt

unread,
Nov 29, 2022, 10:05:42 AM11/29/22
to Google Mobile Ads SDK Developers
Hello,

Yup, I dont know exactly why sometimes the ad fails to load, but it should eventually work if you launch the app multiple times, regardless, I'm attaching a new apk that automatically requests a new ad after the previous one has failed to load.

As per the expected behaviour,  please see the picture attached that proves that the raycast has correctly hit one part of the Ad that should trigger the ad when clicked, but however doesnt do it when only the raycast hits it.



Mobile Ads SDK Forum Advisor

unread,
Nov 29, 2022, 2:31:22 PM11/29/22
to xa...@socialmatchplay.com, google-adm...@googlegroups.com
Hi Xavi,

Thank you for getting back to us. Unfortunately, I'm consistently getting a no fill error on my end as well and cannot further check your app. With that, could you please provide to us a screen recording instead as requested previously? Once provided, I could then share it to the team to get their insight as well and to deliver a decisive resolution to your concern.

Regards,
Google Logo
Teejay Wennie
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2gfPpu:ref

Sankalp Sharma

unread,
Aug 22, 2023, 3:53:38 AM8/22/23
to Google Mobile Ads SDK Developers
Hi Xavi, 

I am facing same issue, native ads click not working if canvas renderer mode is set to Screen Space - Overlay. Do you able to solve this issue?

Please let me know if is there a solution for this.

Thanks in advance.

Mobile Ads SDK Forum Advisor

unread,
Aug 23, 2023, 3:54:18 AM8/23/23
to ssankalp...@gmail.com, google-adm...@googlegroups.com
Hello Sankalp,

Thank you for chiming in to this thread.

It appears that you are encountering the same issue as you mentioned. For us to be able to validate your issue and further investigate, kindly provide the below information as well.
  • Sample app project
  • Steps to replicate
  • SDK version
  • Screen recording of the behavior

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002gfPpuQAE&entry.80707362=00158351

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

 
This message is in relation to case "ref:_00D1U1174p._5004Q2gfPpu:ref"

Thanks,
 
Google Logo Mobile Ads SDK Team


Sankalp Sharma

unread,
Aug 23, 2023, 9:01:03 AM8/23/23
to Google Mobile Ads SDK Developers
I have uploaded the required files in the url given by you. Please check and let me know if you need anything to solve the issue.

Mobile Ads SDK Forum Advisor

unread,
Aug 23, 2023, 12:23:06 PM8/23/23
to ssankalp...@gmail.com, google-adm...@googlegroups.com
Hello Sankalp,

Upon trying to install the APK I've encounter the issue "INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113". You can address this by adding this to the build.gradle within Android block:
splits {
    abi {
        enable true
        reset()
        include 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'mips', 'mips64', 'arm64-v8a'
        universalApk true
    }
}
Kindly send us another APK once this has been added.
Reply all
Reply to author
Forward
0 new messages