Alejandro Alcalde
Alejandro Alcalde

Reputation: 6220

amp-ad show ads on mobile but not on desktop

I have implemented Google AMP pages in my website, but something extrange is happening. The code for the ad is this:

<amp-ad
   width="300"
   height="250"
   type="adsense"
   data-ad-client="{{ site.owner.google.ad-client }}"
   data-ad-slot="{{ site.owner.google.ad-slot3 }}"
   layout="responsive">
   <div fallback>Ad blocked</div>
</amp-ad>

When I visit the page from a mobile device, or with a smaller screen (with the developer tools of the browser) the ad is shown, but from a normal desktop nothing is showing, althouth the space where the ad should be is keeped.

Upvotes: 0

Views: 718

Answers (1)

Alejandro Alcalde
Alejandro Alcalde

Reputation: 6220

It is solved now, the problem was that the parent div container did not have a width specified.

Upvotes: 1

Related Questions