Name That Script!

A presentation at An Event Apart Boston in June 2018 in Boston, MA, USA by Trent Walton

Slide 1

Slide 1

Name 
 That 
 Script!

Slide 2

Slide 2

Hi! paravelinc.com

Slide 3

Slide 3

Hi!

Slide 4

Slide 4

Hi!

Slide 5

Slide 5

Third- Parties?

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

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

Slide 9

Slide 9

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

Slide 10

Slide 10

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

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

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

Slide 13

Slide 13

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

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

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

Slide 16

Slide 16

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

Slide 17

Slide 17

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

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

Image Comps Frontend

Slide 22

Slide 22

Image Comps Frontend Performance

Slide 23

Slide 23

Image Comps Frontend Performance A11Y

Slide 24

Slide 24

Image Comps Frontend Performance A11Y RWD

Slide 25

Slide 25

Image Comps Frontend Performance A11Y RWD Design Systems

Slide 26

Slide 26

Image Comps Frontend Performance A11Y RWD Design Systems Command Line

Slide 27

Slide 27

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

Slide 28

Slide 28

Impact

Slide 29

Slide 29

Prototypes!

Slide 30

Slide 30

Welcome 1 2 3 Next

Slide 31

Slide 31

Welcome 1 2 3

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

Slide 32

Slide 32

Welcome 1 2 3

Slide 33

Slide 33

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

Slide 34

Slide 34

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

Slide 35

Slide 35

Slide 36

Slide 36

Integration!

Slide 37

Slide 37

CMS

Slide 38

Slide 38

Analytics CMS Ad Network

Slide 39

Slide 39

Analytics CMS Ad Network AB Testing Comments E-Commerce

Slide 40

Slide 40

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

Slide 41

Slide 41

CSS PNG JS JPG WOFF Analytics Social AB Testing Ad Network

Slide 42

Slide 42

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

Slide 43

Slide 43

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

Slide 44

Slide 44

twitter.com/csswizardry/status/915886339391918083

Slide 45

Slide 45

Slide 46

Slide 46

Listen and Learn!

Slide 47

Slide 47

Let the work begin!

Slide 48

Slide 48

Analyze & Itemize on the Web Categories & Types Know Industry Averages Impact UX, Perf, Privacy Understand IRL Benefits Take Action

Slide 49

Slide 49

UX, Perf, Privacy Impact

Slide 50

Slide 50

UX + Perf

Slide 51

Slide 51

Please Turn Off Your Ad Blocker

Slide 52

Slide 52

31 requests, 6.7MB

Slide 53

Slide 53

348 requests, 14.7MB

Slide 54

Slide 54

Slide 55

Slide 55

Privacy

Slide 56

Slide 56

This site uses cookies! Got it

Slide 57

Slide 57

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

Slide 58

Slide 58

Remarketing! Spatula Buy Now

Slide 59

Slide 59

Remarketing! Thank you for your purchase

Slide 60

Slide 60

Weather App advertisement Spatula! Shop Now

Slide 61

Slide 61

I’m not evil. But Trent. While I’m here… I was looking at your browser history and wondered if you still wanted that panini press.

Slide 62

Slide 62

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

Slide 63

Slide 63

Don’t wait to be told!

Slide 64

Slide 64

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

Slide 65

Slide 65

Privacy & GDPR Resources

Slide 66

Slide 66

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

Slide 67

Slide 67

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 & GDPR Resources

Slide 68

Slide 68

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

Slide 69

Slide 69

Analytics Categories Comments Social Media Advertising

Slide 70

Slide 70

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

Slide 71

Slide 71

Ghostery ghostery.com

Slide 72

Slide 72

Categories ghostery.com

Slide 73

Slide 73

Categories ghostery.com

Slide 74

Slide 74

Categories ghostery.com

Slide 75

Slide 75

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

Slide 76

Slide 76

Analyze & Itemize

Slide 77

Slide 77

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 78

Slide 78

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 79

Slide 79

Ghostery?

Slide 80

Slide 80

Portable, Please

Slide 81

Slide 81

XLS! CSV! They’re for me!

Slide 82

Slide 82

website.har (JSON) HTTP Archive format HAR

Slide 83

Slide 83

Save as HAR Copy Save All As Har Open in New Tab Start Performance Analysis

http://trentwalton.com

Network Requests Panel

https://trentwalton.com/style.css https://trentwalton.com/mediocrejavascript.js

Slide 84

Slide 84

Now What? HAR website.har

Slide 85

Slide 85

har.tech

Slide 86

Slide 86

charlesproxy.com

Slide 87

Slide 87

Slide 88

Slide 88

Slide 89

Slide 89

By Simon Hearne requestmap.webperf.tools

Slide 90

Slide 90

Request Map for trentwalton.com requestmap.webperf.tools

Slide 91

Slide 91

Request Map for amazon.com requestmap.webperf.tools

Slide 92

Slide 92

Request Map for amazon.com Request Map CSV Export

Slide 93

Slide 93

Know Industry Averages

Slide 94

Slide 94

Alexa Top 50 US Sites

Slide 95

Slide 95

Alexa Top 50 US Sites 49

Slide 96

Slide 96

Alexa Top 50 US Sites 49 46

Slide 97

Slide 97

Slide 98

Slide 98

Third-Party Requests across top 46 US sites

Slide 99

Slide 99

213 Third-Party Domain URLs

  • domains, not requests

Slide 100

Slide 100

22 Average Per Site

Slide 101

Slide 101

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% amazonaws.com 16 34.8% Third-Party Prevalence https://trentwalton.com/tag/Third-Party/

Slide 102

Slide 102

What’s a Demdex? better.fyi/trackers

Slide 103

Slide 103

What’s a Demdex? better.fyi/trackers

Slide 104

Slide 104

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 target.com 29 Volume Per Site

Slide 105

Slide 105

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

Slide 106

Slide 106

News & Shopping Ads Analytics CDN Ratings Comments Social Feedback

Slide 107

Slide 107

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

Slide 108

Slide 108

Understand Benefits

Slide 109

Slide 109

Slide 110

Slide 110

Slide 111

Slide 111

$ $

Slide 112

Slide 112

Slide 113

Slide 113

Vector Media Group Matt Weinberg Lee Goldberg

Slide 114

Slide 114

Analytics Ad Network What’s a Tag Manager? AB Testing

Slide 115

Slide 115

Dashboard

Slide 116

Slide 116

Get Snippets

Slide 117

Slide 117

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 118

Slide 118

Add Tags & Scripts

Slide 119

Slide 119

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 120

Slide 120

Slide 121

Slide 121

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 122

Slide 122

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

Slide 123

Slide 123

CSS PNG JS JPG WOFF Analytics Social AB Testing Ad Network

Slide 124

Slide 124

CSS PNG JS JPG WOFF Analytics Social AB Testing Ad Network

Slide 125

Slide 125

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 126

Slide 126

Slide 127

Slide 127

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

Slide 128

Slide 128

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

Slide 129

Slide 129

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 130

Slide 130

Don’t blame the tool.

Slide 131

Slide 131

Take Action!

Slide 132

Slide 132

Establish a Center of Excellence!

Slide 133

Slide 133

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

Slide 134

Slide 134

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

Slide 135

Slide 135

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

Slide 136

Slide 136

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

Slide 137

Slide 137

Monitor Performance

Slide 138

Slide 138

Make your Case!

Slide 139

Slide 139

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

Slide 140

Slide 140

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

Slide 141

Slide 141

Comparative Data

Slide 142

Slide 142

Get Results

Slide 143

Slide 143

Block Third-Party

Slide 144

Slide 144

Slide 145

Slide 145

Compare Results

Slide 146

Slide 146

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

Slide 147

Slide 147

Compare Results

Slide 148

Slide 148

Compare Results

Slide 149

Slide 149

Talk it out!

Slide 150

Slide 150

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

Slide 151

Slide 151

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

Slide 152

Slide 152

People to Follow / Who Helped Andy Davies 
 Simon Hearne

Matt Weinberg

Lee Goldberg

Harry Roberts

Aral Balkan

Laura Kalbag

Dave Rupert

Slide 153

Slide 153

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 154

Slide 154

Tools I Use Ghostery

Calibre

SpeedCurve

DareBoost

HAR.tech

Charles App

Slide 155

Slide 155

Thanks! @TrentWalton