Chapter 10. Ads and Analytics in AMP
In this chapter, we'll cover ads and analytics support in AMP. While perhaps not the most exciting topics, they are important nonetheless. Analytics can offer insights into how well a website is performing against its goals, and into user behavior and interaction with the site. Ads offer a monetization model for many sites for which there may be no other revenue source available.
We'll start off with analytics and see how to add different types of tracking to our web pages. We'll see how to do the following:
- Track different types of events, such as pageviews, clicks, scrolling, and social sharing
- Apply this to our e-commerce cart, and see how to track addition and removal of products from the cart
- Unify sessions across the AMP cache and the original domain
We'll then look at ad support in AMP, and review the types and formats of ads that can be added to AMP pages.