October 2017
Intermediate to advanced
370 pages
8h 57m
English
A very common ad use case is to include ads within an image carousel. We saw how to build image carousels in Chapter 5, Building Rich Media Pages in AMP. We could easily use an ad as one of the items in a carousel like this (/ch10/ad-carousel.html):
<amp-carousel height="300" layout="fixed-height" type="carousel"> <amp-img src="img/jellyfish1.jpg" width="300" height="300"> </amp-img> <amp-ad width="300" height="300" layout="fixed" data-ad-client="ca-pub-1234567891234567" data-ad-slot="1234567890"> </amp-ad> <amp-img src="img/jellyfish2.jpg" width="300" height="300"> </amp-img></amp-carousel>
This will work both with carousel type="slides" and type="carousel".
Read now
Unlock full access