29
AMP The Good The Bad and The Ugly 1

AMP The Good The Bad and the Ugly

Embed Size (px)

Citation preview

Page 1: AMP The Good The Bad and the Ugly

AMPTheGoodTheBadandTheUgly

1

Page 2: AMP The Good The Bad and the Ugly
Page 3: AMP The Good The Bad and the Ugly

Numbers1 Million - Distinct AMP articles rendered per day.

440k - The size of the average canonical page CSS.

31k - The size of the average AMP page CSS

600ms - Time to convert, from cold, a typical page.

100ms - CPU Time to convert a Page

1 Second - Median DOM Content Loaded.

3

Page 4: AMP The Good The Bad and the Ugly

HTML to AMPHTML Is Easy Mostly.

4

Page 5: AMP The Good The Bad and the Ugly

440K > 50K What do you mean I only

have 50K for CSS?5

Page 6: AMP The Good The Bad and the Ugly

CSS is like that storage unit your in laws have.

6

Page 7: AMP The Good The Bad and the Ugly

The One Big CSS FileModel Should Die

7

Page 8: AMP The Good The Bad and the Ugly

Filter the CSS and only include the rules in use.

Sounds Easy Enough …

8

Page 9: AMP The Good The Bad and the Ugly

CSS Filtering:It doesn’t matter what matches,

just that something does.

Or rather that nothing does…

9

Page 10: AMP The Good The Bad and the Ugly

Find all the Things

10

Page 11: AMP The Good The Bad and the Ugly

Check Each Part

.foo .bar a.baz { … }

If any one part isn’t in the dom delete the selector.

If you’ve deleted all the selectors delete the CSS block.

10 X Faster than $(“.foo .bar a.baz”)

11

Page 12: AMP The Good The Bad and the Ugly

Still Too Big? Rename All The Things

.header-very-long-class-name -> .cd

#veryDescriptiveIdThatIsUsedOnce -> #de

Watch out for

[class^=“very-long-class-“] and amp-*

12

Page 13: AMP The Good The Bad and the Ugly

!important (who named it not important?)

13

Page 14: AMP The Good The Bad and the Ugly

Remember CSS Specificity

14

Page 15: AMP The Good The Bad and the Ugly

#id1 #i12 .selector

15

Page 16: AMP The Good The Bad and the Ugly

Enough of CSS - HTML Edge Cases<iframes are us>

If it’s an <iframe> and it can be https make it an <amp-iframe>

Lots of things can be HTTPS they just don’t admit it.

Examples:

Storify, SurveyGizmo, ispot.tv, ABC TV embeds, C-Span, Kickstarter, gfycat, giphy, livestream

16

Page 17: AMP The Good The Bad and the Ugly

Shims all the way down.Resizable JS element with a shim: Disqus Comments.

AMP Page -> <amp-iframe> (shim) -> <regular iframe>

Shim listens for resize events from regular iframe, passes to AMP

Remember to add placeholder and overflow elements.

Sample:

https://storage.googleapis.com/relay-media-assets/players/disqus-shim.html

17

Page 18: AMP The Good The Bad and the Ugly

amp-list - Not Just for Lists

18

Page 19: AMP The Good The Bad and the Ugly

amp-list - Not Just for Lists

19

Page 20: AMP The Good The Bad and the Ugly

For a Fist Full of Dollars

Put Ads in the Content

300x250 after paragraph 2

300x250’s every N paragraphs.

20

Page 21: AMP The Good The Bad and the Ugly

For a Few Dollars MoreYou need more that DFP -> ADX

Nativo, Teads

Private exchanges

Make sure your video pre-roll works.

Include Direct Sold

21

Page 22: AMP The Good The Bad and the Ugly

Use amp-experiment to Test Ads and UX

data-loading-strategy=“prefer-viewability-over-views”

amp-sticky-ad vs 320x50 top banner

What elements are “road blocks” that cause people to stop reading?

22

Page 23: AMP The Good The Bad and the Ugly

Your Logo Is Important

23

Page 24: AMP The Good The Bad and the Ugly

Don’t Just Use The Masthead Logo

24

Page 25: AMP The Good The Bad and the Ugly

The Ugly

25

Page 26: AMP The Good The Bad and the Ugly

AMP In A Hurricane

26

Page 27: AMP The Good The Bad and the Ugly

27

Page 28: AMP The Good The Bad and the Ugly

Parting thoughts

You don’t ‘do amp’ and leave it.

Validate Every Page.

28