Name That Script!

A presentation at An Event Apart Orlando: Special Edition 2018 in October 2018 in Orlando, FL, USA by Trent Walton

Slide 1

Slide 1

Name That Script!

Slide 2

Slide 2

Hi! para velin c.co m

Slide 3

Slide 3

Hi!

Slide 4

Slide 4

Hi!

Slide 5

Slide 5

ThirdParties?

Slide 6

Slide 6

Third-Party Any request made by a webpage coming from an external URL

Slide 7

Slide 7

Third-Party Scripts and Services http://trentwalton.com

Slide 8

Slide 8

Third-Party Scripts and Services http://trentwalton.com Network Requests Panel https://trentwalton.com/style.css https://trentwalton.com/mediocrejavascript.js

Slide 9

Slide 9

Third-Party Scripts and Services http://trentwalton.com Network Requests Panel https://trentwalton.com/style.css https://trentwalton.com/mediocrejavascript.js https://p.typekit.net/p.css

Slide 10

Slide 10

Third-Party Scripts and Services http://trentwalton.com

Slide 11

Slide 11

Third-Party Any request made by a webpage coming from an external URL Any resource included with a webpage that the site owner doesn’t explicitly control

Slide 12

Slide 12

Third-Party Scripts and Services http://trentwalton.com Network Requests Panel https://trentwalton.com/style.css https://trentwalton.com/mediocrejavascript.js

Slide 13

Slide 13

Third-Party Scripts and Services http://trentwalton.com Network Requests Panel https://trentwalton.com/style.css https://trentwalton.com/mediocrejavascript.js https://evilcorp.com/ssssshhhhh.js

Slide 14

Slide 14

http://trentwalton.com Network Requests Panel https://trentwalton.com/style.css https://trentwalton.com/mediocrejavascript.js https://evilcorp.com/ssssshhhhh.js

Slide 15

Slide 15

Third-Party Uses Advertising CDN Ad networks, Ad content Cloudflare, AWS, etc. AB Testing Customer Interaction Analytics Comments Social Media Essential Maxymiser, Optimizely, etc. Site traffic, trackers, etc. Embeds, sign up, share buttons Live chat, feedback widgets Disqus, etc. Tag managers, fonts, etc.

Slide 16

Slide 16

Third-Party Benefits Data / Decision Drivers Analytics + AB Testing Income Ads, Analytics, Trackers Content CDNs for Fonts, Images, Videos, etc. Functionality Comments, Chat, Tag Managers, IFrame embeds

Slide 17

Slide 17

Third-Party Concerns User Experience Poor Performance (Load Time + Processor Lag), Inconsistent UI Privacy Customer/User Trust, Organizational Reputation, Data protection

Slide 18

Slide 18

Why do I care about third-parties?

Slide 19

Slide 19

Slide 20

Slide 20

Image Comps

Slide 21

Slide 21

Frontend Image Comps

Slide 22

Slide 22

Performance Frontend Image Comps

Slide 23

Slide 23

A11Y Performance Frontend Image Comps

Slide 24

Slide 24

RWD A11Y Performance Frontend Image Comps

Slide 25

Slide 25

Design Systems RWD A11Y Performance Frontend Image Comps

Slide 26

Slide 26

Command Line Design Systems RWD A11Y Performance Frontend Image Comps

Slide 27

Slide 27

Third-Parties Command Line Design Systems RWD A11Y Performance Frontend Image Comps

Slide 28

Slide 28

Why?

Slide 29

Slide 29

Impact

Slide 30

Slide 30

Prototypes!

Slide 31

Slide 31

Welcome 1 2 Next 3

Slide 32

Slide 32

Welcome 1 2 3

<ul role="tablist"> <li> <a href="#first-tab" role="tab" ariaselected="true" aria-controls="first-tab">

Slide 33

Slide 33

Welcome 1 2 3

Slide 34

Slide 34

WOFF JPG CSS Shrink-O-Matic CSS PNG JS JPG WOFF CSS JPG W

Slide 35

Slide 35

Buttons Fonts Patterns Footer Forms Primary Secondary Grid Header Buttons Navigation Use only one primary button per component. Tables

Slide 36

Slide 36

Slide 37

Slide 37

Integration!

Slide 38

Slide 38

CMS

Slide 39

Slide 39

Analytics CMS Ad Network

Slide 40

Slide 40

Analytics CMS Ad Network AB Testing E-Comm Comments

Slide 41

Slide 41

Analytics CMS Ad Network AB Testing Trackers E-Commerce Comments Bus Social Sign

Slide 42

Slide 42

JPG CSS PNG WOF F JS A Netwd ork AB Testi ng Anal ytics Socia l

Slide 43

Slide 43

Analytics v2.0.1 Ad Network v2.0.2 AB Testing v2.0.3

Slide 44

Slide 44

Delivering a performant, accessible, responsive, scalable website isn’t enough: I also need to consider the impact of third-party scripts.

Slide 45

Slide 45

twitter.com/csswizardry/status/915886339391918083

Slide 46

Slide 46

Slide 47

Slide 47

Why? How?

Slide 48

Slide 48

What can I do?

Slide 49

Slide 49

Don’t speak. (yet)

Slide 50

Slide 50

Research is fun!

Slide 51

Slide 51

6 Parts…

Slide 52

Slide 52

Categories & Types Analyze & Itemize Third-Parties Know Industry Averages Impact UX, Perf, Privacy Understand IRL Benefits Take Action

Slide 53

Slide 53

Categories Advertising Analytics Comments Social Media

Slide 54

Slide 54

Categories Advertising CDN Ad networks, Ad content Cloudflare, AWS, etc. AB Testing Customer Interaction Maxymiser, Optimizely, etc. Live chat, feedback widgets Analytics Comments Google, Chartbeat, etc. Disqus, etc. Social Media Essential Embeds, sign up, share buttons Tag managers, fonts, etc.

Slide 55

Slide 55

Ghostery ghostery.com

Slide 56

Slide 56

Categories ghostery.com

Slide 57

Slide 57

Categories ghostery.com

Slide 58

Slide 58

Categories ghostery.com

Slide 59

Slide 59

Categories Advertising CDN Ad networks, Ad content Cloudflare, AWS, etc. AB Testing Customer Interaction Maxymiser, Optimizely, etc. Live chat, feedback widgets Analytics Comments Google, Chartbeat, etc. Disqus, etc. Social Media Essential Embeds, sign up, share buttons Tag managers, fonts, etc.

Slide 60

Slide 60

Analyze & Itemize

Slide 61

Slide 61

Pop quiz, hotshot… You want an itemized list of all third-parties on a web page. How do you get it!?

Slide 62

Slide 62

View Source? view-source:http://trentwalton.com <html lang=“en-us”> <head> <link href="https://use.typekit.net/iwu3yfx.css" rel="stylesheet"> <script src="//cdnjs.cloudflare.com/jquery.min.js"></script> </head> <body>

Slide 63

Slide 63

View Source? view-source:http://trentwalton.com <html lang=“en-us”> <head> <link rel="shortcut icon" href="https://static.nytimes.com/favicon.ico" /> <link rel="apple-touch-icon-precomposed" sizes="144×144" href="https://static.nytimes.com/images/icons/ios-ipad-144x144.png" /> <link rel="apple-touch-icon-precomposed" sizes="114×114" href="https://static.nytimes.com/images/icons/ios-iphone-114x144.png" /> <link rel="apple-touch-icon-precomposed" href="https://static.nytimes.com/images/icons/ios-default-homescreen-57x57.png" /> <meta name="sourceApp" content="nyt-v5" /> <meta id="applicationName" name="applicationName" content="homepage" /> <meta id="foundation-build-id" name="foundation-build-id" content="" /> <link rel="canonical" href="https://www.nytimes.com" /> <link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml" /> <link rel="alternate" media="only screen and (max-width: 640px)" href="http://mobile.nytimes.com" /> <link rel="alternate" media="handheld" href="http://mobile.nytimes.com" /> <meta name="robots" content="noarchive,noodp,noydir" /> <meta name="description" content="The New York Times: Find breaking news, multimedia, reviews & opinion on Washington, business, sports, movies, travel, books, jobs, education, real estate, cars & more at nytimes.com." /> <meta name="CG" content="Homepage" /> <meta name="SCG" content="" />

Slide 64

Slide 64

Ghostery?

Slide 65

Slide 65

Portable, Please

Slide 66

Slide 66

XLS! CSV! They’re for me!

Slide 67

Slide 67

HTTP Archive format (more work, more portable data) HAR website.har (JSON)

Slide 68

Slide 68

Save as HAR http://trentwalton.com Network Requests Panel Copy https://trentwalton.com/style.css Save All As Har Open in New Tab https://trentwalton.com/mediocrejavascript.js Start Performance Analysis

Slide 69

Slide 69

Now What? HAR website.har

Slide 70

Slide 70

har.tech

Slide 71

Slide 71

charlesproxy.com

Slide 72

Slide 72

Slide 73

Slide 73

Slide 74

Slide 74

requestmap.webperf.tools (less work, visual results) By Simon Hearne

Slide 75

Slide 75

requestmap.webperf.tools Request Map for trentwalton.com

Slide 76

Slide 76

requestmap.webperf.tools Request Map for amazon.com

Slide 77

Slide 77

Request Map CSV Export Request Map for amazon.com

Slide 78

Slide 78

BuiltWith.com (less work, summarized results)

Slide 79

Slide 79

Slide 80

Slide 80

Slide 81

Slide 81

Slide 82

Slide 82

Slide 83

Slide 83

Know Industry Averages

Slide 84

Slide 84

Alexa Top 50 US Sites

Slide 85

Slide 85

Alexa Top 50 US Sites 9 4

Slide 86

Slide 86

Alexa Top 50 US Sites 9 4 6 4

Slide 87

Slide 87

Slide 88

Slide 88

Third-Party Requests across top 46 US sites

Slide 89

Slide 89

213 Third-Party Domain URLs * domains, not requests

Slide 90

Slide 90

22 Average Per Site

Slide 91

Slide 91

Third-Party Prevalence https://trentwalton.com/tag/Third-Party/ Third-party domain

of top 46 sites

% of top 46 sites doubleclick.net 38 82.6% facebook.com 32 69.6% google-analytics.com 27 58.7% googlesyndication.com 25 54.3% googleadservices.com 24 52.2% cloudfront.net 20 43.5% googleapis.com 20 43.5% scorecardresearch.com 18 39.1% 2mdn.net 17 37.0% adnxs.com 17 37.0% fastly.net 17 37.0% akamaihd.net 16 34.8%

Slide 92

Slide 92

What’s a Demdex? better.fyi/trackers

Slide 93

Slide 93

What’s a Demdex? better.fyi/trackers

Slide 94

Slide 94

Volume Per Site Alexa Site Third-Party Domains nytimes.com 64 washingtonpost.com 63 Metropcs.mobi 59 cnn.com 57 ebay.com 49 msn.com 45 microsoft.com 43 wikia.com 42 salesforce.com 40 bestbuy.com 38 imdb.com 37 twitch.tv 37 espn.com 36 wordpress.com 32

Slide 95

Slide 95

Which sites had the most? News Shopping nytimes.com washingtonpost.com cnn.com msn.com espn.com ebay.com bestbuy.com target.com amazon.com walmart.com

Slide 96

Slide 96

News & Shopping Ads Analytics Comments CDN Social Ratings Feedback

Slide 97

Slide 97

Further Reading trentwalton.com/notes/2018/01/23/third-party-script-prevalence-on-alexa-top-50.html

Slide 98

Slide 98

UX, Perf, Privacy Impact

Slide 99

Slide 99

UX + Perf

Slide 100

Slide 100

We feel third-party impact anytime we browse the web.

Slide 101

Slide 101

But I have one story…

Slide 102

Slide 102

31 requests, 6.7MB

Slide 103

Slide 103

348 requests, 14.7MB

Slide 104

Slide 104

Food Network Request Map

Slide 105

Slide 105

Two Extremes…

Slide 106

Slide 106

Slide 107

Slide 107

Does your site depend on third-parties to function?

Slide 108

Slide 108

If your site breaks when I visit it with a content blocker, whose problem is it?

Slide 109

Slide 109

25–40% US Internet users block ads https://www.businessinsider.com/30-of-all-internet-users-will-ad-block-by-2018-2017-3 https://marketingland.com/survey-shows-us-ad-blocking-usage-40-percent-laptops-15-percent-mobile-216324

Slide 110

Slide 110

https://twitter.com/firefox/status/1035202844188712960

Slide 111

Slide 111

Supporting contentblocked browsers?

Slide 112

Slide 112

Privacy

Slide 113

Slide 113

This site uses cookies! Got it

Slide 114

Slide 114

https://twitter.com/jasonfried/status/1003979608042164230

Slide 115

Slide 115

Remarketing! Spatula Buy Now

Slide 116

Slide 116

Remarketing! Thank you for your purchase

Slide 117

Slide 117

Weather App advertisement Spatula! Shop Now

Slide 118

Slide 118

Browsing History amazon.com/panini cheesysandwiches.com facebook.com/political-thing facebook.com/timeline twitter.com/moment

Slide 119

Slide 119

Don’t wait to be told!

Slide 120

Slide 120

Privacy Third-Parties Command Line Design Systems RWD A11Y Performance Frontend Image

Slide 121

Slide 121

Privacy & GDPR Resources

Slide 122

Slide 122

Privacy & GDPR Resources GDPR (General Data Protection Regulation) https://www.smashingmagazine.com/2018/02/gdpr-for-web-developers/

Slide 123

Slide 123

Privacy & GDPR Resources GDPR (General Data Protection Regulation) https://www.smashingmagazine.com/2018/02/gdpr-for-web-developers/ Privacy by Design (PbD) https://www.smashingmagazine.com/2017/07/privacy-by-design-framework/

Slide 124

Slide 124

Privacy & GDPR Resources GDPR (General Data Protection Regulation) https://www.smashingmagazine.com/2018/02/gdpr-for-web-developers/ Privacy by Design (PbD) https://www.smashingmagazine.com/2017/07/privacy-by-design-framework/ Privacy Impact Assessment https://www.gsa.gov/reference/gsa-privacy-program/privacy-impactassessments-pia

Slide 125

Slide 125

Understand Benefits

Slide 126

Slide 126

Slide 127

Slide 127

Slide 128

Slide 128

$ $

Slide 129

Slide 129

Slide 130

Slide 130

Vector Media Group Matt Weinberg Lee Goldberg

Slide 131

Slide 131

What’s a Tag Manager? AB ng i t s e T A Netwd ork A l a n s c i yt

Slide 132

Slide 132

Dashboard

Slide 133

Slide 133

Get Snippets

Slide 134

Slide 134

Add Snippets view-source:http://trentwalton.com <html lang=“en-us”> <head> <script src=“Tag Manager Script Here”></script> </head> <body> <noscript><iframe>Tag Manager Script</iframe></noscript>

Slide 135

Slide 135

Add Tags & Scripts

Slide 136

Slide 136

Pandora’s Box? view-source:http://trentwalton.com <html lang=“en-us”> <head> <script src=“Tag Manager Script Here”></script> </head> <body> <noscript><iframe>Tag Manager Script</iframe></noscript>

Slide 137

Slide 137

Slide 138

Slide 138

Get Organized view-source:http://trentwalton.com <html lang=“en-us”> <head> <script src=“Tag Manager Script Here”></script> </head> <body> <noscript><iframe>Tag Manager Script</iframe></noscript>

Slide 139

Slide 139

“An analytics strategy should be part of the initial development and design process […]” —Lee Goldberg

Slide 140

Slide 140

JPG CSS PNG WOF F JS A Netwd ork AB Testi ng Anal ytics Socia l

Slide 141

Slide 141

JPG CSS WOFF PNG JS Ad Network AB Testing Analytics Social

Slide 142

Slide 142

It’s too easy to add scripts. view-source:http://trentwalton.com <html lang=“en-us”> <head> <script src=“Tag Manager Script Here”></script> </head> <body> <noscript><iframe>Tag Manager Script</iframe></noscript>

Slide 143

Slide 143

Slide 144

Slide 144

“We work towards a global maximum versus a local maximum. Small, hyper-focused changes may seem good at the time…

Slide 145

Slide 145

but we have to be mindful of the overall quality of the user-experience and integrity of the brand.” —Matt Weinberg

Slide 146

Slide 146

Ads and analytics work together to help our clients. view-source:http://trentwalton.com <html lang=“en-us”> <head> <script src=“Tag Manager Script Here”></script> </head> <body> <noscript><iframe>Tag Manager Script</iframe></noscript>

Slide 147

Slide 147

Don’t blame the tool.

Slide 148

Slide 148

Take Action!

Slide 149

Slide 149

Establish a Center of Excellence!

Slide 150

Slide 150

Define Standards 1 Determine value to the business/website 2 Avoid redundant scripts and services 3 Fit within established performance budget 4 Comply with organizational privacy policy

Slide 151

Slide 151

Document Standards Third-Party Standards Styles Components Our goal is to document and regularly evaluate the value of third-party inclusions, optimizing benefits while minimizing the UX/Performance impact. Voice Perf Third-Parties Inventory AB Testing - Optimizely 300kb WebPage Test 73kb WebPage Test Comments - Disqus 120kb WebPage Test Ads - Doubleclick 100kb WebPage Test 80kb WebPage Test Analytics - Chartbeat Ads - Adnxs

Slide 152

Slide 152

Account For Third-Parties During Prototyping Analytics Ad Network AB Testing

Slide 153

Slide 153

Audit Third-Parties Third-Party Size Budgeted Issue Optimizely 365kb 200kb Perf Budget Maxymizer 190kb Outbrain 645b 1kb Chartbeat 700b 1kb Analytics - Google 26kb 50kb 169kb 100kb Ads - Adnxs 80kb 100kb Ads - Rubicon Project 90kb 100kb Ads - Doubleclick Redundant Perf Budget

Slide 154

Slide 154

Monitor Performance

Slide 155

Slide 155

Make your Case!

Slide 156

Slide 156

Competitive Analysis Competitor A Our Site 12 39 1.2 Third-Parties HTTP Requests Megabytes 35 78 3 Third-Parties HTTP Requests Megabytes Competitor B 4 24 2 Third-Parties HTTP Requests Megabytes

Slide 157

Slide 157

Gather Compelling Results wpostats.com/2017/03/03/bbc-load-abandonment.html

Slide 158

Slide 158

Comparative Data

Slide 159

Slide 159

Get Results

Slide 160

Slide 160

Block Third-Party

Slide 161

Slide 161

Slide 162

Slide 162

Compare Results

Slide 163

Slide 163

Use Real User Monitoring (RUM) soasta.com/blog/what-if-analysis-predictive-analytics/

Slide 164

Slide 164

Compare Results

Slide 165

Slide 165

Compare Results

Slide 166

Slide 166

Talk it out!

Slide 167

Slide 167

“Everything should have a value, because everything has a cost.” —Tim Kadlec

Slide 168

Slide 168

Slides! Links! https://noti.st/trentwalton https://speakerdeck.com/trentwalton

Slide 169

Slide 169

People to Follow / Who Helped Andy Davies Simon Hearne Matt Weinberg Lee Goldberg Harry Roberts Aral Balkan Laura Kalbag Dave Rupert

Slide 170

Slide 170

Links From Slides https://twitter.com/csswizardry/status/915886339391918083 https://twitter.com/jasonfried/status/1003979608042164230 https://en.wikipedia.org/wiki/General_Data_Protection_Regulation https://en.wikipedia.org/wiki/Privacy_by_design https://www.smashingmagazine.com/2018/02/gdpr-for-web-developers/ https://www.ghostery.com https://calibreapp.com https://speedcurve.com https://www.dareboost.com https://har.tech https://www.charlesproxy.com http://requestmap.webperf.tools/ https://trentwalton.com/tag/Third-Party https://better.fyi/trackers https://trentwalton.com/notes/2018/01/23/third-party-script-prevalence-on-alexa-top-50.html https://wpostats.com/2017/03/03/bbc-load-abandonment.html https://www.webpagetest.org

Slide 171

Slide 171

Tools I Use Ghostery Calibre SpeedCurve DareBoost HAR.tech Charles App Request Map Generator BuiltWith

Slide 172

Slide 172

Thanks! @TrentWalton