scttcper / react-adsense

Adsense component for react
https://react-adsense.xmplaylist.com
MIT License
92 stars 18 forks source link

Rendering 300x50 height ad always rendering 300x250 ad block #37

Open zdraganov opened 1 week ago

zdraganov commented 1 week ago

I have set up an ad with horizontal layout 300 width, 50 height, working in test mode. When I tried to use that one with the Adsense it renders 300x250 empty block.

  <Adsense
    className='adsbygoogle'
    client='ca-pub-XXXXXXXXXX'
    slot='XXXXXXXX'
    adTest={adTest}
    style={{ width: '300px', height: '50px', display: 'lightblue' }}
  />

When I try to do the same but with tag, it works.

<ins className="adsbygoogle"
        client='ca-pub-XXXXXXX'
        slot='XXXXXXX'
        adTest={adTest}
        style={{width: "300px", height: "50px", background: 'lightblue' }}
></ins>

Any idea what I am doing wrong?

scttcper commented 1 week ago

maybe adTest vs data-adtest https://github.com/scttcper/react-adsense/blob/master/src/adsense.tsx#L58