-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
675 lines (588 loc) · 34.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Web Analytics & Tracking 101 | William Durand</title>
<link rel="stylesheet" href="reveal.js/css/reveal.css">
<link rel="stylesheet" href="reveal.js/css/theme/white.css" id="theme">
<link rel="stylesheet" href="reveal.js/lib/css/zenburn.css">
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="css/fix-fontawesome-reveal-js.css">
<link rel="stylesheet" href="css/custom.css">
<script>
document.write('<link rel="stylesheet" href="reveal.js/css/print/' +
(window.location.search.match(/print-pdf/gi) ? 'pdf' : 'paper') +
'.css" type="text/css" media="print">'
);
</script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1 class="title">Web Analytics & Tracking 101</h1>
<br>
<em>William Durand — May 30, 2016</em>
</section>
<section data-markdown>
<script type="text/template">
## Agenda
* Web Analytics
* Google Analytics
* Web Tracking
* The NSA
</script>
</section>
<section>
<section data-markdown>
<script type="text/template">
# Web Analytics
</script>
</section>
<section data-markdown>
<script type="text/template">
## Definition
**Web analytics** is the **measurement**, **collection**, **analysis**<br>and **reporting**
of web data for purposes of **understanding**<br>and **optimizing web usage**.
<br>
* It can be used as a tool for business and market research
* There are two categories of web analytics:
- **off-site** web analytics
- **on-site** web analytics
</script>
</section>
<section data-markdown>
<script type="text/template">
## Off-Site WA
Off-site web analytics refers to web measurement and analysis regardless of
whether you own/maintain a website.
</script>
</section>
<section data-markdown>
<script type="text/template">
## On-Site WA
On-site web analytics measures a **visitor's behavior<br>once on your website**.
There are two main technical<br>ways of collecting the data: **server log file
analysis**,<br>and **page tagging**.
<br>
<br>
<i class="fa fa-hand-o-right"></i> [Google Analytics](http://www.google.com/analytics/) is the most
widely used on-site web<br>analytics service. [Piwik](http://piwik.org/) is its Open-Source
alternative.
</script>
</section>
<section data-markdown>
<script type="text/template">
## Server Log File Analysis (1/2)
Web servers record some of their transactions in a **logfile**.
In the early 1990s, web site statistics consisted of counting the number
of client requests (**hits**) made to the web server.
<br>
This was a reasonable method initially, since each web site<br>often consisted of a
single HTML file. However, with the introduction of images in HTML, and web
sites that spanned multiple HTML files, this count became less useful.
<br>
<i class="fa fa-hand-o-right"></i> [AWStats](http://awstats.sourceforge.net/) and [Webalizer](http://www.webalizer.org/)
are the most well-known<br>web server log analysis softwares.
</script>
</section>
<section data-markdown>
<script type="text/template">
## Server Log File Analysis (2/2)
Two units of measure were introduced in the mid-1990s to gauge more accurately
the amount of human activity on web servers:
* **page views**: a request made to the web server for a page,
* **visits** or **sessions**: a sequence of requests from a uniquely identified
client that expired after a certain amount of inactivity.
<br>
Because of caching, this method is not accurate enough.
</script>
</section>
<section data-markdown data-background="images/bg-1990.jpeg" class="oldies">
<script type="text/template">
## Page Tagging (1/3)
In the mid-1990s, Web counters were commonly seen:
<img src="images/webcounter.gif" class="no-border" />
<img src="images/construction.gif" class="no-border" />
<marquee>U Can't Touch This!</marquee>
</script>
</section>
<section data-markdown>
<script type="text/template">
## Page Tagging (2/3)
In the late 1990s this concept evolved to include a
**small invisible image** (called a [web
bug](http://en.wikipedia.org/wiki/Web_bugs)) rather
than a visible one, and, by **using JavaScript**,
**to pass** along with the image request certain
**information about the page** and **the visitor**.
<br>
This information can then be processed remotely by
a web analytics company, and extensive statistics
generated.
</script>
</section>
<section data-markdown>
<script type="text/template">
## Page Tagging (3/3)
Historically, vendors of page-tagging analytics solutions have used **third-party
cookies** sent from the vendor's domain instead of the domain of the website
being browsed.
Third-party cookies can handle visitors who cross multiple unrelated domains within
the company's site, since the cookie is always handled by the vendor's servers.
However, there are two problems: **privacy concerns** and **cookie deletion**.
<br>
Most vendors of page tagging solutions have now moved to provide at least the option
of using **first-party cookies** (i.e. cookies assigned from the client subdomain).
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
# Google Analytics
</script>
</section>
<section data-markdown>
<script type="text/template">
## Overview
Google Analytics works by the **inclusion of a block of JavaScript code on pages**
in your website. When users to your website view a page, this JavaScript code
references a JavaScript file which then executes the **tracking operation**.
<br>
The tracking operation retrieves data about the page request through various
means and **sends this information** to the<br>Google Analytics server **via a list
of parameters attached to<br>a single-pixel image request**.
</script>
</section>
<section data-markdown>
<script type="text/template">
### How Does The Tracking Code Work? (1/2)
1. A browser requests a web page that contains the tracking code
2. A JavaScript `Array` named `_gaq` is created and tracking commands are pushed onto the array
3. A `<script>` element is created and enabled for asynchronous loading
4. The `ga.js` tracking code is fetched. Once fetched and loaded, the commands on the
`_gaq` array are executed and the array is transformed into a tracking object
5. Loads the script element to the DOM
6. After the tracking code collects data, the GIF request is sent to the Analytics database for
logging and post-processing
</script>
</section>
<section data-markdown>
<script type="text/template">
### How Does The Tracking Code Work? (2/2)
<img src="images/ga-tracking.png" class="no-border" />
</script>
</section>
<section data-markdown>
<script type="text/template">
### How Does Google Analytics Collect Data? (1/2)
The **data used** to provide all the information in Google
<br>Analytics **reports** comes from three different sources:
* The **HTTP request** of the user (hostname, the browser type, referrer, language)
* Browser/system information (Java and Flash support, screen resolution thanks to the DOM)
* First-party cookies (in order to obtain user session)
</script>
</section>
<section data-markdown>
<script type="text/template">
### How Does Google Analytics Collect Data? (2/2)
When all this information is collected, it is sent
to the Google Analytics servers in the form of a
**long list of parameters** attached to a
**single-pixel GIF image** request:
<pre><code>http://www.google-analytics.com/__utm.gif?
utmac=UA-30138-1& // Account
utmcc=__utma%3D97315849.1774621898...& // Cookie values
utmdt=analytics%20page%20test& // Page title
utmfl=9.0%20r48& // Flash version
utmhn=example.com& // Hostname
utmn=769876874& // Unique ID to prevent caching
utmcs=ISO-8859-1& // Language enc.
utmsr=1280x1024& // Screen resolution
utmsc=32-bit& // Screen color depth
utmul=en-us& // Browser language
...
</code></pre>
<small>
<i class="fa fa-book"></i> [The Google Analytics GIF Request
Parameters](https://developers.google.com/analytics/resources/articles/gaTrackingTroubleshooting#gifParameters)
</small>
</script>
</section>
<section>
<p><img src="images/google-analytics.png" class="no-border" /></p>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
# Web Tracking
</script>
</section>
<section data-markdown>
<script type="text/template">
## Definition
**Web tracking** or **Website visitor tracking** is the analysis of visitor
behaviour on a website. Analysis of an individual visitor's behaviour may be
used to provide that visitor with options or content that relates to their
implied preferences.
</script>
</section>
<section data-markdown>
<script type="text/template">
## It Is All About Cookies!!!
(Well, most of the time)
</script>
</section>
<section data-markdown>
<script type="text/template">
## Cookies (1/2)
A cookie is _a small piece of data sent from a website and stored in a user's
web browser while the user is browsing that website_ according to
[Wikipedia](http://en.wikipedia.org/wiki/HTTP_cookie).
<br>
Every time the user loads the website, **the browser sends the cookies back**
to the server to notify the website of the user's previous activity.
</script>
</section>
<section data-markdown>
<script type="text/template">
## Cookies (2/2)
Cookies have some **important implications** on the<br>**privacy** and
**anonymity** of web users.
<br>
While cookies are sent only to the server setting them or a server in
the same Internet domain, a web page may contain images or other components
stored on servers in other domains.
Cookies that are set during retrieval of these components are called
**third-party cookies**. Advertising companies use third-party cookies to
track a user across multiple sites.
</script>
</section>
<section data-markdown>
<script type="text/template">
### EU Cookie Directive
The **EU cookie directive** requires websites to
gain permission from users, before planting cookies
with two exceptions:
* Some cookies can be exempted from informed consent
under certain conditions if they are not used for
additional purposes (_e.g._, cookies used to keep
track of a user's input when filling online forms
or as a shopping cart);
* First-party analytics cookies are not likely to
create a privacy risk if websites provide clear
information about the cookies to users and privacy
safeguards.
![](images/cookie-law.png)
</script>
</section>
<section data-markdown>
<script type="text/template">
### How Do Third-Party Tracking Cookies work? (1/4)
Let's say you have four websites:
* gizmodo.com
* slashdot.org
* wired.com
* facebook.com
You are a user, and you visit each of these websites.
Each of these websites also works with a third-party company whose
job is to serve ads, and named: `badboys.com`.
On every page of these websites, there is a web bug that points to
`badboys.com`'s adserver and requests an ad.
</script>
</section>
<section data-markdown>
<script type="text/template">
### How Do Third-Party Tracking Cookies work? (2/4)
Assuming `gizmodo.com` knows your age and gender,
when visiting it, the following request is made:
http://badboys.com/adrequest?site=gizmodo.com?age=25&gender=m
1. Browser requests content
2. Server requests cookies (if any)
3. Browser sends cookies
4. Server does some black magic, and picks an ad
5. Server returns new cookie data, and the ad
6. Browser displays this ad
</script>
</section>
<section data-markdown>
<script type="text/template">
### How Do Third-Party Tracking Cookies work? (3/4)
Even though you are visiting the site
`gizmodo.com`, the cookie is under the domain
`badboys.com`.
When the server returns new cookie data, it puts in
there when you last visited `gizmodo.com` and how
many times you’ve been there today.
<br>
Now let's say you spend the morning watching tech-news on
`gizmodo.com`, `slashdot.org`, and `wired.com`, all the while
receiving ads from `badboys.com`. Each page you view gives them
a little bit more information about you.
</script>
</section>
<section data-markdown>
<script type="text/template">
### How Do Third-Party Tracking Cookies work? (4/4)
Now, you go to `facebook.com`. Serving an ad for such a website is
complicated as it depends on how you use Facebook. Maybe you didn't
fill in enough information to know your age, your gender or things
you like.
<br>
**But**, let's walk through the steps of a Facebook's ad call to
`badboys.com` in more details!
</script>
</section>
<section data-markdown>
<script type="text/template">
### 1. Browser Requests Content
<br>
http://badboys.com/adrequest?site=facebook.com
</script>
</section>
<section data-markdown>
<script type="text/template">
### 2. Server Requests Cookies (If Any)
</script>
</section>
<section data-markdown>
<script type="text/template">
### 3. Browser Sends Cookies
<br>
* Cookie contains your age & gender (25 & male) (encrypted)
* Cookie shows you visited `gizmodo.com` 12 times this morning
* Cookie shows you visited `slashdot.org` 3 times this morning
* Cookie shows you visited `wired.com` once this morning
</script>
</section>
<section data-markdown>
<script type="text/template">
### 4. Server Does Some Black Magic,<br>And Picks An Ad
<br>
* Server puts user data (_25, male, 16 visits to tech sites_) into a **profile engine**
* Profile engine represents **categories**, say `male`, `tech`
* Server looks for ad campaigns targeted to `male` **and** `tech`
* Server picks highest paying `male` and `tech` targeted ad campaign
<br>
_That's the black magic!_
</script>
</section>
<section data-markdown>
<script type="text/template">
### 5. Server Returns New Cookie Data,<br>And The Ad
</script>
</section>
<section data-markdown>
<script type="text/template">
### 6. Browser Displays This Ad
</script>
</section>
<section data-markdown>
<script type="text/template">
### Conclusion
Instead of showing you a random ad, `badboys.com`
is able to show you a highly relevant and targeted
advertisement that you are far more likely to click
on.
</script>
</section>
<section data-markdown>
<script type="text/template">
### And...
Given how much tracking companies know about your
browsing history, it is worth asking whether these
companies also know who you are. The answer,
unfortunately, appears to be **yes**, at least for
those of you who use social networking sites.
</script>
</section>
<section data-markdown>
<script type="text/template">
### Paths For Data Leakage From<br>Social Networks To Third-Party Tracking Companies
<br>
The most obvious way that a third-party tracker
(remember `badboys.com`?) might learn which account
on a social networking site is yours via the **HTTP
`Referrer` header**.
A typical URL on a social networking site includes
a username or user ID number, and any third-party
will be able to see that.
</script>
</section>
<section data-markdown>
<script type="text/template">
### What Can You Do?
1. Pick a **good cookie policy** for your browser, like **only keep
cookies until I close my browser**, or manual approval of all cookies
2. **Disable Flash cookies** and all the other kinds of **super cookies**
3. Use browser **extensions to control when third-party sites can include
content** in your pages or run code in your browser
3. Use [uBlock](https://www.ublock.org/) (ad blocker)
5. [Privacy Badger](https://www.eff.org/privacybadger) ([Ghostery](https://www.ghostery.com/en/) is controversed)
6. [TOR](https://www.torproject.org/)? [Tails](https://tails.boum.org/)?
<br>
Also, check out [panopticlick.eff.org](https://panopticlick.eff.org), and
[Lightbeam](http://www.mozilla.org/fr/lightbeam/)!
</script>
</section>
<section data-markdown>
<script type="text/template">
### Is your browser safe against tracking? (1/3)
<br>
**Browser fingerprinting** is a method of tracking
web<br>browsers by the configuration and settings
information<br>they make visible to websites.
<br>
If your browser is **unique**, then it's possible
that **an online tracker can identify you** even
without setting tracking cookies.
<br>
<small>
<i class="fa fa-book"></i> Paper: [How Unique Is Your Web Browser?](https://panopticlick.eff.org/static/browser-uniqueness.pdf)
</small>
</script>
</section>
<section data-markdown>
<script type="text/template">
### Is your browser safe against tracking? (2/3)
<br>
**Canvas fingerprinting** is a more sophisticated
type of browser fingerprinting technique. Entropy
is due to Operating System, browser, GPU, and
graphics driver. In short:
* Relies on a hidden HTML5 `<canvas>`
* JavaScript renders text and drawing
* The final bitmap is then converted into a unique token
<br>
<small>
<i class="fa fa-book"></i> Paper: [The Web Never Forgets: Persistent Tracking Mechanisms in the Wild](https://securehomes.esat.kuleuven.be/~gacar/persistent/the_web_never_forgets.pdf)
</small>
</script>
</section>
<section data-markdown class="no-border">
<script type="text/template">
### Canvas Fingerprinting
![](images/canvas_fig.png)
![](images/canvas_imgs.png)
<small>
Source: https://securehomes.esat.kuleuven.be/~gacar/persistent/index.html
</small>
</script>
</section>
<section data-markdown class="no-border">
<script type="text/template">
### Is your browser safe against tracking? (3/3)
**History stealing** with CSS `:visited`
![](images/css-leak.png)
<small>
<i class="fa fa-book"></i> [Plugging the CSS History Leak](https://blog.mozilla.org/security/2010/03/31/plugging-the-css-history-leak/)
/ [Extra Lecture: Privacy on the Web](http://www.ccs.neu.edu/home/amislove/teaching/cs3700/spring15/lectures/lecture21.pdf)
</small>
</script>
</section>
<section data-markdown>
<script type="text/template">
## [jenairienacacher.fr](http://jenairienacacher.fr/)
</script>
</section>
<section data-markdown>
<script type="text/template">
## Are We Safe?
![](images/nope.gif)
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
# The NSA
</script>
</section>
<section>
<img src="images/nsa.png" />
<small>
A slide from an internal NSA presentation indicating that the agency uses at least one
<br>Google cookie as a way to identify targets for exploitation. Thank you <strong>Edward Snowden</strong>!
</small>
</section>
<section data-markdown>
<script type="text/template">
## Google's PREF Cookie
Google assigns a **unique PREF cookie** anytime
someone's browser makes a connection to any of the
company's Web properties or services.
This can occur when consumers directly use Google
services (Search, Maps, etc.), or when they visit
websites that contain **embedded widgets** (Google Plus).
That cookie contains a code that allows Google to
uniquely<br>track users to **personalize ads**.
</script>
</section>
<section data-markdown>
<script type="text/template">
## What The F**k?
The **NSA** and its British counterpart, **GCHQ**, **are
using cookies** that advertising networks place on
computers **to identify people** browsing the Internet.
<br>
The intelligence agencies have found particular use
for a part of a Google-specific tracking mechanism
known as the **PREF cookie**.
These cookies typically don't contain personal
information, but they do contain numeric codes that
enable websites to uniquely identify a person's
browser.
</script>
</section>
</section>
<section data-markdown>
<script type="text/template">
## Thank You.
### Questions?
<br>
<br>
<ul class="me">
<li>
<p><i class="fa fa-globe"></i><a href="http://williamdurand.fr" title="website">williamdurand.fr</a></p>
</li>
<li>
<p><i class="fa fa-github"></i><a href="https://github/willdurand" title="github">github.com/willdurand</a></p>
</li>
<li>
<p><i class="fa fa-twitter"></i><a href="https://twitter.com/couac" title="twitter">twitter.com/couac</a></p>
</li>
</ul>
</script>
</section>
</div>
</div>
<script src="reveal.js/lib/js/head.min.js"></script>
<script src="reveal.js/js/reveal.js"></script>
<script>
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
slideNumber: true,
theme: Reveal.getQueryHash().theme,
transition: Reveal.getQueryHash().transition || 'concave',
dependencies: [
{ src: 'reveal.js/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'reveal.js/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'reveal.js/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'reveal.js/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
]
});
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-28365039-1', 'williamdurand.fr');
ga('send', 'pageview');
</script>
<a href="https://github.com/willdurand-edu/web-tracking-101-slides"><img style="position: absolute; top: 0; right: 0; border: 0; border-radius: none; box-shadow: none;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png" alt="Fork me on GitHub"></a>
</body>
</html>