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