Skip to content

Commit 63390ca

Browse files
Updated analytics readme. Resolves #1229. (#1236)
* Added tracking of empty result set. Resolves #1229. * Updated analytics readme. Resolves #1229.
1 parent b9c5f91 commit 63390ca

File tree

1 file changed

+136
-18
lines changed

1 file changed

+136
-18
lines changed

google-analytics.md

Lines changed: 136 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
The following custom dimensions are configured in Google Analytics, allowing additional data (in addition to Category, Action and Label) to be included in each data layer event fired from the front end.
66

77
- `currentQuery`
8+
- `direction`
9+
- `entityId`
810
- `entityType`
911
- `entityUrl`
1012
- `facet`
1113
- `fileFormat`
1214
- `fileName`
1315
- `fileType`
16+
- `index`
1417
- `min`
1518
- `max`
1619
- `releaseName`
@@ -29,13 +32,14 @@ The following custom dimensions are configured in Google Analytics, allowing add
2932
- Label: `termName` or `between 0 and 100 years`
3033

3134

32-
- Entity Type: "Facet"
3335
- Current Query: `currentQuery`
36+
- Entity Type: "Facet"
3437
- Facet: `facetName`
35-
- Term: `termName` or `between 0 and 100 years`
36-
- Source: "Cohort Export", "Manifest Export", "Cohort Matrix", "Facet Browser", "Search" or "Selected Terms"
37-
- Min: `min`
38+
- Index: `index`
3839
- Max: `max`
40+
- Min: `min`
41+
- Source: "Cohort Export", "Manifest Export", "Cohort Matrix", "Facet Browser", "Search" or "Selected Terms"
42+
- Term: `termName` or `between 0 and 100 years`
3943

4044
###### Clear Search Terms
4145

@@ -44,10 +48,20 @@ The following custom dimensions are configured in Google Analytics, allowing add
4448
- Label: "Clear All"
4549

4650

47-
- Entity Type: "Facet"
4851
- Current Query: `currentQuery`
52+
- Entity Type: "Facet"
53+
- Index: `index`
4954
- Source: "Selected Terms"
5055

56+
###### Empty Search Results
57+
58+
- Category: "Search"
59+
- Action: "Exception"
60+
- Label: "Empty Result Set"
61+
62+
- Current Query: `currentQuery`
63+
- Index: `index`
64+
5165

5266
##### Sort Events
5367

@@ -57,9 +71,29 @@ The following custom dimensions are configured in Google Analytics, allowing add
5771
- Action: "Sort"
5872
- Label: `sortBy`
5973

60-
- Entity Type: "Projects", "Samples" or "Files"
61-
- Current Query: `currentQuery`
6274
- Direction: "Asc" or "Desc"
75+
- Current Query: `currentQuery`
76+
- Index: `index`
77+
78+
##### Page Events
79+
80+
###### Next Page
81+
82+
- Category: "Search Results"
83+
- Action: "Next Page"
84+
- Label: `currentPageNumber`
85+
86+
- Current Query: `currentQuery`
87+
- Index: `index`
88+
89+
###### Previous Page
90+
91+
- Category: "Search Results"
92+
- Action: "Previous Page"
93+
- Label: `currentPageNumber`
94+
95+
- Current Query: `currentQuery`
96+
- Index: `index`
6397

6498
##### Project Events
6599

@@ -256,11 +290,26 @@ Visualize events are configured as:
256290

257291
### GTM "Data Layer" Variables
258292

259-
##### Entity Type Name
293+
##### Current Query
294+
- Selected search terms at time of event.
295+
- Used to capture `currentQuery` dimension from front end data layer.
296+
- Corresponds to `currentQuery` custom dimension in Google Analytics.
297+
298+
##### Direction
299+
- Specific to sort actions.
300+
- Used to capture `direction` dimension from front end data layer.
301+
- Corresponds to `direction` custom dimension in Google Analytics.
302+
303+
##### Entity Id
304+
- Used to capture `entityId` dimension from front end data layer.
305+
- Corresponds to `entityId` custom dimension in Google Analytics.
306+
307+
##### Entity Type
308+
- UI entity type (see `index` for data entity type).
260309
- Used to capture `entityType` dimension from front end data layer.
261310
- Corresponds to `entityType` custom dimension in Google Analytics.
262311

263-
##### Entity URL Name
312+
##### Entity URL
264313
- Used to capture `entityUrl` dimension from front end data layer.
265314
- Corresponds to `entityUrl` custom dimension in Google Analytics.
266315

@@ -272,6 +321,11 @@ Visualize events are configured as:
272321
- Used to capture `eventLabel` dimension from front end data layer.
273322
- Corresponds to the Label value in a Google Analytics event.
274323

324+
##### Facet
325+
- Used by search-related events when facet term is selected.
326+
- Used to capture `facet` dimension from front end data layer.
327+
- Corresponds to `facet` custom dimension in Google Analytics.
328+
275329
##### File Format
276330
- Used to capture `fileFormat` dimension from front end data layer.
277331
- Corresponds to `fileFormat` custom dimension in Google Analytics.
@@ -284,10 +338,35 @@ Visualize events are configured as:
284338
- Used to capture `fileType` dimension from front end data layer.
285339
- Corresponds to `fileType` custom dimension in Google Analytics.
286340

341+
##### Index
342+
- Data entity type (eg Projects, Samples, Files).
343+
- Used to capture `index` dimension from front end data layer.
344+
- Corresponds to `index` custom dimension in Google Analytics.
345+
346+
##### Min
347+
- Specific to age range searches.
348+
- Used to capture `min` dimension from front end data layer, used during
349+
- Corresponds to `min` custom dimension in Google Analytics.
350+
351+
##### Max
352+
- Specific to age range searches.
353+
- Used to capture `max` dimension from front end data layer, used during
354+
- Corresponds to `max` custom dimension in Google Analytics.
355+
287356
##### Release Name
288357
- Used to capture `releaseName` dimension from front end data layer.
289358
- Corresponds to `releaseName` custom dimension in Google Analytics.
290359

360+
##### Source
361+
- UI element where event was triggered from.
362+
- Used to capture `source` dimension from front end data layer.
363+
- Corresponds to `source` custom dimension in Google Analytics.
364+
365+
##### Term
366+
- Used by search-related events when facet term is selected.
367+
- Used to capture `term` dimension from front end data layer.
368+
- Corresponds to `term` custom dimension in Google Analytics.
369+
291370
##### Tool Name
292371
- Used to capture `fileType` dimension from front end data layer.
293372
- Corresponds to `fileType` custom dimension in Google Analytics.
@@ -326,6 +405,16 @@ Visualize events are configured as:
326405
- Sends "Cohort Matrix Copy to Clipboard" event to Google Analytics when `Cohort Matrix Copy to Clipboard` trigger is fired.
327406
- Event data includes Category, Action and Label as well as Entity Type and Entity URL dimensions.
328407

408+
#### Entity Return to Tab
409+
- Fired when tab (Projects, Samples, Files) is returned to from project detail or get dat flow.
410+
- Sends "Entity Return to Tab" event to Google Analytics when `Entity Return to Tab` trigger is fired.
411+
- Event data includes Category, Action and Label as well as the Current Query dimension.
412+
413+
#### Entity Select Tab
414+
- Fired when tab is selected (Projects, Samples, Files).
415+
- Sends "Entity Select Tab" event to Google Analytics when `Entity Select Tab` trigger is fired.
416+
- Event data includes Category, Action and Label as well as the Current Query dimension.
417+
329418
#### Export Request
330419
- Sends "Export Request" event to Google Analytics when `Export Request` trigger is fired.
331420
- Event data includes Category, Action and Label as well as Entity Type and Tool Name dimensions.
@@ -338,18 +427,50 @@ Visualize events are configured as:
338427
- Sends "Export Copy to Clipboard" event to Google Analytics when `Export Copy to Clipboard` trigger is fired.
339428
- Event data includes Category, Action and Label as well as Entity Type, Entity URL and Tool Name dimensions.
340429

341-
#### Dataset Download
342-
- Sends "Download" event to Google Analytics when `Dataset Download` trigger is fired.
430+
#### Portal Link
431+
- Sends "Portal Link" event to Google Analytics when `Portal Link` trigger is fired.
432+
- Event data includes Category, Action and Label as well as Entity URL, Current Query and Source dimensions.
433+
434+
#### Project Manifest Request
435+
- Sends "Project Manifest Request" event to Google Analytics when `Project Manifest Request` trigger is fired.
436+
- Event data includes Category, Action and Label as well as Entity Type and Entity URL dimensions.
437+
438+
#### Project Manifest Download
439+
- Sends "Project Manifest Download" event to Google Analytics when `Project Manifest Download` trigger is fired.
440+
- Event data includes Category, Action and Label as well as Entity Type and Entity URL dimensions.
441+
442+
#### Project Manifest Download Link Copy to Clipboard
443+
- Sends "Project Manifest Copy to Clipboard" event to Google Analytics when `Project Manifest Copy to Clipboard` trigger is fired.
444+
- Event data includes Category, Action and Label as well as Entity Type and Entity URL dimensions.
445+
446+
#### Project View Tab
447+
- Sends "Project View Tab" event to Google Analytics when `Project View Tab` trigger is fired.
448+
- Event data includes Category, Action and Label as well as Entity URL, Entity ID and Current Query dimensions.
449+
450+
#### Release Download
451+
- Sends "Download" event to Google Analytics when `Release Download` trigger is fired.
343452
- Event data includes Category, Action and Label as well as Entity URL, File Format, File Name, File Type and Release Name dimensions.
344453

345-
#### Dataset Copy to Clipboard
346-
- Sends "Copy to Clipboard" event to Google Analytics when `Dataset Copy to Clipboard` trigger is fired.
454+
#### Release Copy to Clipboard
455+
- Sends "Copy to Clipboard" event to Google Analytics when `Release Copy to Clipboard` trigger is fired.
347456
- Event data includes Category, Action and Label as well as Entity URL, File Format, File Name, File Type and Release Name dimensions.
348457

349-
#### Dataset Visualize
350-
- Sends "Visualize" event to Google Analytics when `Dataset Visualize` trigger is fired.
458+
#### Release Visualize
459+
- Sends "Visualize" event to Google Analytics when `Release Visualize` trigger is fired.
351460
- Event data includes Category, Action and Label as well as Release Name and Tool Name dimensions.
352461

462+
#### Search
463+
- Sends "Search" event to Google Analytics when `Search` trigger is fired.
464+
- Event data includes Category, Action and Label as well as Entity ID, Entity Type, Current Query, Facet, Term, Source, Min, Max, and Index dimensions.
465+
466+
#### Search Results Page
467+
- Sends "Search Results Page" event to Google Analytics when `Search Results Page` trigger is fired.
468+
- Event data includes Category, Action and Label as well as Current Query and Index dimensions.
469+
470+
#### Search Results Sort
471+
- Sends "Search Results Sort" event to Google Analytics when `Search Results Sort` trigger is fired.
472+
- Event data includes Category, Action and Label as well as Current Query and Index dimensions.
473+
353474
### Front End Data Layer Event Configuration
354475

355476
```
@@ -368,6 +489,3 @@ where:
368489
- `eventLabel` is the Label value sent to Google Analytics, always the full URL to the file or visualization tool.
369490
- `dimension0` represents a dimension to be included in the event values sent to Google Analytics (eg `datasetName`, `toolName`, `releaseName`).
370491

371-
### Deployment
372-
373-
Currently published to develop, ux-dev, integration, staging and production.

0 commit comments

Comments
 (0)