🐛 The bug
ScriptGoogleAdsense types and documents data-ad-layout="in-feed", but AdSense throws:
TagError: adsbygoogle.push() error: Invalid data-ad-layout value: in-feed
Google in-feed units do not use data-ad-layout. The snippet AdSense generates is:
<insclass="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-6t+ed+2i-1n-4w"
data-ad-client="ca-pub-XXXXXXXXXXXXXXXX"
data-ad-slot="XXXXXXXXXX"></ins>
ScriptGoogleAdsense has no data-ad-layout-key prop. Extra attributes fall through to the wrapper div, not the <ins>, so the layout key cannot be passed through.
Valid data-ad-layout in AdSense is in-article. in-feed in the component prop union looks like a mix-up with data-ad-layout-key.
Minimal reproduction:
<template>
<ScriptGoogleAdsense
data-ad-slot="YOUR_IN_FEED_SLOT"
data-ad-format="fluid"
data-ad-layout="in-feed"
:data-full-width-responsive="false"
/>
</template>
Docs: https://scripts.nuxt.com/scripts/google-adsense#using-the-scriptgoogleadsense-component
🛠️ To reproduce
none
🌈 Expected behavior
Either:
- Add a
data-ad-layout-key prop and bind it on the <ins>, and remove in-feed from data-ad-layout, or - Document that in-feed units must be a raw
<ins>, and that data-ad-layout is only for in-article.
The docs currently list data-ad-layout as in-article, in-feed, fixed: https://scripts.nuxt.com/scripts/google-adsense#using-the-scriptgoogleadsense-component
ℹ️ Additional context
@nuxt/scripts1.3.2 (same on current main)- Component props today:
dataAdFormat?: 'auto'|'rectangle'|'vertical'|'horizontal'|'fluid'|'autorelaxed'
dataAdLayout?: 'in-article'|'in-feed'|'fixed'
The <ins> only binds:
data-ad-clientdata-ad-slotdata-ad-formatdata-ad-layoutdata-full-width-responsive
🐛 The bug
ScriptGoogleAdsensetypes and documentsdata-ad-layout="in-feed", but AdSense throws:Google in-feed units do not use
data-ad-layout. The snippet AdSense generates is:ScriptGoogleAdsensehas nodata-ad-layout-keyprop. Extra attributes fall through to the wrapperdiv, not the<ins>, so the layout key cannot be passed through.Valid
data-ad-layoutin AdSense isin-article.in-feedin the component prop union looks like a mix-up withdata-ad-layout-key.Minimal reproduction:
Docs: https://scripts.nuxt.com/scripts/google-adsense#using-the-scriptgoogleadsense-component
🛠️ To reproduce
none
🌈 Expected behavior
Either:
data-ad-layout-keyprop and bind it on the<ins>, and removein-feedfromdata-ad-layout, or<ins>, and thatdata-ad-layoutis only forin-article.The docs currently list
data-ad-layoutasin-article, in-feed, fixed: https://scripts.nuxt.com/scripts/google-adsense#using-the-scriptgoogleadsense-componentℹ️ Additional context
@nuxt/scripts1.3.2(same on currentmain)The
<ins>only binds:data-ad-clientdata-ad-slotdata-ad-formatdata-ad-layoutdata-full-width-responsive