Native ad unit codes from the API are not identical to AdSense UI

87 views
Skip to first unread message

Advanced Ads

unread,
Sep 30, 2021, 10:14:06 AM9/30/21
to AdSense API Forum
Hi there,

version 2.0 of the AdSense Management API delivers wrong ad unit codes for native ads.

Using the codes from the API causes the In-feed ad unit to not show up. In-article and Matched Content show up, but I am not sure if they are identical. I.e., In-article might fall back to display as "Display" ads.

An example for In-feed:

Code from the API:

<!-- In-feed -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-123"
     data-ad-slot="321"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

Code for the same ad unit from the AdSense account UI:

     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block"
     data-ad-format="fluid"
     data-ad-layout-key="-6j+ed+2i-1n-4w"
     data-ad-client="ca-pub-123"
     data-ad-slot="321"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>

This also happened with 1.4, until we reported it a while ago, and then delivering ad unit codes for native ads was at least stopped. That wasn’t perfect but allowed us to offer alternatives to users.

Was this overlooked in API 2.0 or did I miss something?

Thomas

Ad Sense API

unread,
Sep 30, 2021, 4:29:04 PM9/30/21
to adsen...@googlegroups.com
Hi, Thomas.

Thanks for bringing this to our attention. I've raised a bug with an engineer who can correct this issue. For the short term, they will throw errors on in-feed/in-article/matched-content Ad Units, similar to the v1.4 behavior. Long term, they will look into the possibility of sending the same ad codes for these Ad Units as the UI does. Does that solution meet your use case?

Google Logo
Donovan McMurray
AdSense API Team
 


ref:_00D1U1174p._5004Q2OVV2R:ref

Advanced Ads

unread,
Oct 6, 2021, 1:47:11 PM10/6/21
to AdSense API Forum
Hi Donovan,

thank you, that is exactly what we were looking for!
Reply all
Reply to author
Forward
0 new messages