scttcper / ng2-adsense

Angular Adsense Component
https://ng2-adsense.xmplaylist.com
MIT License
138 stars 24 forks source link

Height is always 280px for Auto Ads #379

Open petermarks12 opened 5 years ago

petermarks12 commented 5 years ago

I am using this library with Angular 5 and as suggested, I am using ng-adsense version 5.4.3.

Width is working fine, but why height is always 280px, no matter what. Also, I tried using className property, but it also does not set class to ins element of google, instead to the ng-adsense element which has absolutely no impact

<ng-adsense [adSlot]="XXX" [display]="'block'" [adFormat]="'auto'" [width]="728" [height]="90" className="'make-responsive'">

polakdominik commented 5 years ago

Yeah, I'm having same issue.

tomfordweb commented 4 years ago

Same in Angular 8 Version 6.0.0

favdev commented 4 years ago

Yep same here

scttcper commented 4 years ago

did you try display inline-block? https://support.google.com/adsense/answer/9467650?hl=en

favdev commented 4 years ago

Thanks for replying. Can see that the ad's height is as specified now (because I've coloured the background) but now there is nothing in the ins tag after I specified display:inline-block

scttcper commented 4 years ago

Might depend on what height you chose and how Adsense is feeling that moment lol

favdev commented 4 years ago

Is there a specific height it should be, or some sort of setting? It's totally fine if I remove display: inline-block

tomfordweb commented 4 years ago

I ended up writing my own component uses the <ins> tag provided by Google to get past this,

One thing I did learn while doing this is that the ad wrapper honors media queries. I would give this a shot if you are still having issues with this.

https://support.google.com/adsense/answer/9183363?hl=en

mouradski commented 4 years ago

Same issue here

btw thanks for your work :)

Sebastien-Remy commented 4 years ago

I ended up writing my own component uses the <ins> tag provided by Google to get past this,

One thing I did learn while doing this is that the ad wrapper honors media queries. I would give this a shot if you are still having issues with this.

https://support.google.com/adsense/answer/9183363?hl=en

@tomfordweb can you give more explanations please ?

itsrajverma commented 3 years ago

any update on this guys?

Blaarkies commented 2 years ago

@itsrajverma This seems to work, not sure if it has any consequences: Add adFormat="inline" to the tag, the style don't get applied when this is set. Other values might also work, as long as it does not default to auto