Some of you might be wondering why I bothered adding an author field in the article info section. I always write the stuff on here myself, right? Today I can finally reveal the purpose of this illustrious addition: this blog was built with the possibility of guest bloggers in mind. Now is the time to make good use of this feature, so bear with me and let yourself be swept away by the Analytics team of Internet Architects.
to sync or to async?
We at the Internet Architects WebAnalytics department - WAIA in short - are serious about data and data quality. That's why we were all excited about the release of the Google Analytics Asynchronous tracking code snippet in December 2009. The benefits seemed obvious, as stated on Steve Souders' blog:
Faster page loads and improved uptime: the script now loads without blocking the downloads of other resources.
More data equals more accurate results as early click-aways will now be measured more accurately compared to the synchronous tracking snippet.
The first benefit seems clear: the asynchronous script call leads to ga.js being downloaded parallel to other resources - a good thing for a functional website script as the tracking code adds no new content to a page. After the script is fully downloaded the page view calls (and other GA methods) will be executed.
So how to verify whether the accuracy of data generated by the asynchronous tracking code is more accurate than the data generated by the synchronous tracking code? The answer is simple: the improved tracking code should track more page views and visits since there is less data loss due to early-click aways from pages.
Below you can find a test, set up to verify this improved data accuracy. After all, in a web analytics environment the data itself is already quite the subject of discussion, so let's try to make sure we don't pollute our messy data even more.
synchronous versus asynchronous tracking code snippet
We performed the test on this very blog. The test was implemented as follows:
Leave the current tracking code as-is: synchronous and implemented inline before the closing body-container.
Add the asynchronous tracking code as additional measurement (using a different UA) before the closing head-container, as prescribed by Google Analytics.
Check results in the GA front-end.
Following the async code's raison d'être we expected the traffic data to be more or less the same, with slightly more traffic measured by the asynchronous tracking code as this version is supposed to have lesser data loss due to early click-aways. The actual results looked like this:
Visits: more data measured with the asynchronous tracking code. Page views: less data measured with the asynchronous tracking code.
The results for measured visits are in line with the expectations: more visits are recorded by the asynchronous tracking code snippet because early click-aways are recorded more accurately. However we didn't expect to see that more page views would be measured by the synchronous code. Following the same logic as before we would expect to see a rise in page views equal to the higher amount of visits.
So we performed a more detailed check, comparing the results on a day-per-day basis:
segment: all visits
visits
pageviews
date
sync
async
delta
sync
async
delta
12-aug-2010
422
464
42
705
749
44
13-aug-2010
400
454
54
694
706
12
14-aug-2010
229
275
46
324
390
66
15-aug-2010
285
242
-43
680
481
-199
16-aug-2010
401
401
0
633
699
66
17-aug-2010
378
427
49
736
768
32
18-aug-2010
381
411
30
658
656
-2
19-aug-2010
378
395
17
640
668
28
20-aug-2010
301
358
57
525
556
31
21-aug-2010
172
187
15
274
310
36
22-aug-2010
245
245
0
462
415
-47
23-aug-2010
380
384
4
662
643
-19
24-aug-2010
390
392
2
683
653
-30
25-aug-2010
370
419
49
646
698
52
26-aug-2010
322
337
15
546
546
0
27-aug-2010
304
353
49
456
531
75
28-aug-2010
202
208
6
361
322
-39
29-aug-2010
233
202
-31
370
311
-59
30-aug-2010
354
350
-4
568
556
-12
31-aug-2010
409
428
19
816
793
-23
01-sept-2010
370
395
25
761
748
-13
02-sept-2010
376
401
25
601
657
56
03-sept-2010
320
358
38
533
566
33
04-sept-2010
214
232
18
379
347
-32
05-sept-2010
219
223
4
362
376
14
06-sept-2010
360
371
11
635
626
-9
07-sept-2010
415
428
13
825
806
-19
08-sept-2010
373
406
33
722
742
20
09-sept-2010
381
406
25
607
585
-22
10-sept-2010
330
370
40
517
554
37
11-sept-2010
200
200
0
468
418
-50
12-sept-2010
213
211
-2
338
350
12
13-sept-2010
380
388
8
643
599
-44
14-sept-2010
460
458
-2
814
714
-100
15-sept-2010
397
443
46
779
871
92
16-sept-2010
464
469
5
880
837
-43
17-sept-2010
314
395
81
526
651
125
18-sept-2010
216
226
10
335
329
-6
19-sept-2010
265
240
-25
398
308
-90
20-sept-2010
450
455
5
735
743
8
21-sept-2010
415
466
51
733
753
20
22-sept-2010
464
464
0
1013
998
-15
23-sept-2010
425
474
49
791
796
5
24-sept-2010
349
399
50
717
748
31
25-sept-2010
217
246
29
375
412
37
26-sept-2010
251
238
-13
429
358
-71
27-sept-2010
411
406
-5
718
615
-103
28-sept-2010
388
443
55
676
809
133
29-sept-2010
372
371
-1
721
661
-60
30-sept-2010
420
454
34
734
775
41
total
16985
17968
983
30204
30203
-1
In the table above, a green table cell in the delta column indicates an expected result (more data measured by asynchronous code). A red table cell indicates an unexpected result (more data measured by the synchronous code).
These results are more or less consistent with previous findings, but they still offer little in the way of explanation as we encounter plenty of fluctuations in the delta columns. We had to dig deeper, finding a way to evaluate the performance of the measurements of early click-aways of the GA async code versus the sync tracking code. The closest match was to segment on bounced visits versus not bounced visits within GA:
Bounced visits segment: Number of page views equals 1.
Non bounce-visits segment: GA built-in segment.
These are the results summed up in two tables.
segment: bounced visits
visits
pageviews
date
sync
async
delta
delta%
sync
async
delta
delta%
12-aug-2010
309
361
52
16,8%
309
361
52
16,8%
13-aug-2010
291
364
73
25,1%
291
364
73
25,1%
14-aug-2010
185
225
40
21,6%
185
225
40
21,6%
15-aug-2010
223
193
-30
-13,5%
223
193
-30
-13,5%
16-aug-2010
311
329
18
5,8%
311
329
18
5,8%
17-aug-2010
268
321
53
19,8%
268
321
53
19,8%
18-aug-2010
284
324
40
14,1%
284
324
40
14,1%
19-aug-2010
285
313
28
9,8%
285
313
28
9,8%
20-aug-2010
226
284
58
25,7%
226
284
58
25,7%
21-aug-2010
139
155
16
11,5%
139
155
16
11,5%
22-aug-2010
184
199
15
8,2%
184
199
15
8,2%
23-aug-2010
296
312
16
5,4%
296
312
16
5,4%
24-aug-2010
285
299
14
4,9%
285
299
14
4,9%
25-aug-2010
279
334
55
19,7%
279
334
55
19,7%
26-aug-2010
240
263
23
9,6%
240
263
23
9,6%
27-aug-2010
236
279
43
18,2%
236
279
43
18,2%
28-aug-2010
152
169
17
11,2%
152
169
17
11,2%
29-aug-2010
180
161
-19
-10,6%
180
161
-19
-10,6%
30-aug-2010
262
273
11
4,2%
262
273
11
4,2%
31-aug-2010
288
323
35
12,2%
288
323
35
12,2%
01-sept-2010
268
294
26
9,7%
268
294
26
9,7%
02-sept-2010
293
324
31
10,6%
293
324
31
10,6%
03-sept-2010
235
278
43
18,3%
235
278
43
18,3%
04-sept-2010
161
187
26
16,1%
161
187
26
16,1%
05-sept-2010
158
170
12
7,6%
158
170
12
7,6%
06-sept-2010
270
289
19
7,0%
270
289
19
7,0%
07-sept-2010
292
327
35
12,0%
292
327
35
12,0%
08-sept-2010
275
314
39
14,2%
275
314
39
14,2%
09-sept-2010
295
336
41
13,9%
295
336
41
13,9%
10-sept-2010
256
302
46
18,0%
256
302
46
18,0%
11-sept-2010
143
151
8
5,6%
143
151
8
5,6%
12-sept-2010
163
165
2
1,2%
163
165
2
1,2%
13-sept-2010
291
315
24
8,2%
291
315
24
8,2%
14-sept-2010
356
371
15
4,2%
356
371
15
4,2%
15-sept-2010
295
346
51
17,3%
295
346
51
17,3%
16-sept-2010
324
351
27
8,3%
324
351
27
8,3%
17-sept-2010
231
307
76
32,9%
231
307
76
32,9%
18-sept-2010
164
185
21
12,8%
164
185
21
12,8%
19-sept-2010
199
201
2
1,0%
199
201
2
1,0%
20-sept-2010
340
345
5
1,5%
340
345
5
1,5%
21-sept-2010
296
363
67
22,6%
296
363
67
22,6%
22-sept-2010
333
349
16
4,8%
333
349
16
4,8%
23-sept-2010
311
371
60
19,3%
311
371
60
19,3%
24-sept-2010
246
303
57
23,2%
246
303
57
23,2%
25-sept-2010
164
200
36
22,0%
164
200
36
22,0%
26-sept-2010
189
197
8
4,2%
189
197
8
4,2%
27-sept-2010
312
331
19
6,1%
312
331
19
6,1%
28-sept-2010
289
340
51
17,6%
289
340
51
17,6%
29-sept-2010
261
272
11
4,2%
261
272
11
4,2%
30-sept-2010
309
365
56
18,1%
309
365
56
18,1%
total
12642
14130
1488
11,8%
12642
14130
1488
11,8%
segment: non-bounced visits
visits
pageviews
date
sync
async
delta
delta%
sync
async
delta
delta%
12-aug-2010
113
103
-10
-8.8%
396
388
-8
-2.0%
13-aug-2010
109
90
-19
-17.4%
403
342
-61
-15.1%
14-aug-2010
44
50
6
13.6%
139
165
26
18.7%
15-aug-2010
62
49
-13
-21.0%
457
288
-169
-37.0%
16-aug-2010
90
72
-18
-20.0%
322
370
48
14.9%
17-aug-2010
110
106
-4
-3.6%
468
447
-21
-4.5%
18-aug-2010
97
87
-10
-10.3%
374
332
-42
-11.2%
19-aug-2010
93
82
-11
-11.8%
355
355
0
0.0%
20-aug-2010
75
74
-1
-1.3%
299
272
-27
-9.0%
21-aug-2010
33
32
-1
-3.0%
135
155
20
14.8%
22-aug-2010
61
46
-15
-24.6%
278
216
-62
-22.3%
23-aug-2010
84
72
-12
-14.3%
366
331
-35
-9.6%
24-aug-2010
105
93
-12
-11.4%
398
354
-44
-11.1%
25-aug-2010
91
85
-6
-6.6%
367
364
-3
0.8%
26-aug-2010
82
74
-8
-9.8%
306
283
-23
-7.5%
27-aug-2010
68
74
6
8.8%
22
252
32
14.5%
28-aug-2010
50
39
-11
-22.0%
209
153
-56
-26.8%
29-aug-2010
53
41
-12
-22.6%
190
150
-40
-21.1%
30-aug-2010
92
77
-15
-16.3%
306
283
-23
-7.5%
31-aug-2010
121
105
-16
-13.2%
528
470
-58
-11.0%
01-sept-2010
102
101
-1
-1.0%
493
454
-39
-7.9%
02-sept-2010
83
77
-6
-7.2%
308
333
25
8.1%
03-sept-2010
85
80
-5
-5.9%
298
288
-10
-3.4%
04-sept-2010
53
45
-8
-15.1%
218
160
-58
-26.6%
05-sept-2010
61
53
-8
-13.1%
204
206
2
1.0%
06-sept-2010
90
82
-8
-8.9%
365
337
-28
-7.7%
07-sept-2010
123
101
-22
-17.9%
533
479
-54
-10.1%
08-sept-2010
98
92
-6
-6.1%
447
428
-19
-4.3%
09-sept-2010
86
70
-16
-18.6%
312
249
-63
-20.2%
10-sept-2010
74
68
-6
-8.1%
261
252
-9
-3.4%
11-sept-2010
57
49
-8
-14.0%
325
267
-58
-17.8%
12-sept-2010
50
46
-4
-8.0%
175
185
10
5.7%
13-sept-2010
89
73
-16
-18.0%
352
284
-68
-19.3%
14-sept-2010
104
87
-17
-16.3%
458
343
-115
-25.1%
15-sept-2010
102
97
-5
-4.9%
484
525
41
8.5%
16-sept-2010
140
118
-22
-15.7%
556
486
-70
-12.6%
17-sept-2010
83
88
5
6.0%
295
344
49
16.6%
18-sept-2010
52
41
-11
-21.2%
171
144
-27
-15.8%
19-sept-2010
66
39
-27
-40.9%
199
107
-92
-46.2%
20-sept-2010
110
110
0
0.0%
395
398
3
0.8%
21-sept-2010
119
103
-16
-13.4%
437
390
-47
-10.8%
22-sept-2010
131
115
-16
-12.2%
680
649
-31
-4.6%
23-sept-2010
114
103
-11
-9.6%
480
425
-55
-11.5%
24-sept-2010
103
96
-7
-6.8%
471
445
-26
-5.5%
25-sept-2010
53
46
-7
-13.2%
211
212
1
0.5%
26-sept-2010
62
41
-21
-33.9%
240
161
-79
-32.9%
27-sept-2010
99
75
-24
-24.2%
406
284
-122
-30.0%
28-sept-2010
99
103
4
4.0%
387
469
82
21.2%
29-sept-2010
111
99
-12
-10.8%
460
389
-71
-15.4%
30-sept-2010
111
89
-22
-19.8%
425
410
-15
-3.5%
total
4343
3838
-505
-11.6%
17562
16073
-1489
-8.5%
The results are stunning:
The asynchronous tracking code has improved measuring performance for bounced visits: almost 12% more visits measured compared to the synchronous tracking code.
The asynchronous tracking code's results are worse for multiple page visits: 8,5% less pageviews are measured compared to the synchronous tracking code.
conclusions
The results of these tests lead us to conclude that a website might benefit from the asynchronous tracking code only if it has a high bounce rate. Then again we must consider the merits of measuring more bounced visits: we receive more accurate data on the visitors who click away early, at the same time we lose about 20% data on our other visitors, while the latter category is by far the more interesting group of visits to analyze.
So how is this possible? Why does the async code measure 8,5% less pageviews? For the moment we are assuming (and of course investigating) that there might be a difference in the way the browser handles the async versus the sync script code, causing these differences. You will hear from us again when we have more results to back these assumptions...