Skip to content

Commit fa285f7

Browse files
committed
adding ga docs
1 parent 1480f06 commit fa285f7

File tree

1 file changed

+118
-0
lines changed

1 file changed

+118
-0
lines changed

google-analytics.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
### Google Analytics
2+
3+
#### Events
4+
5+
There are currently two release-related events captured by Google Analytics: `Download` and `Visualize`. Both events send core event data (Category, Action and Label) as well as additional event-related data as dimensions (eg Dataset Name, Release Name, Tool Name) every time they are fired.
6+
7+
These two events are fired by the front end according to the Google Tag Manager configuration.
8+
9+
##### Download Events
10+
11+
Download events are configured as:
12+
13+
- Category: "Dataset"
14+
- Action: "Download"
15+
- Label: `http://path/to/download`
16+
17+
- Dataset Name: `datasetName`
18+
- File Extension: `fileExtension`
19+
- File Name: `fileName`
20+
- File Type: `fileType`
21+
- Release Name: `releaseName`
22+
23+
##### Visualize Events
24+
25+
Visualize events are configured as:
26+
27+
- Category: "Dataset"
28+
- Action: "Visualize"
29+
- Label: `http://path/to/visualization-tool`
30+
31+
- Dataset Name: `datasetName`
32+
- Release Name: `releaseName`
33+
- Tool Name: `toolName`
34+
35+
#### Custom Dimensions
36+
37+
The following custom dimensions are configured in Google Analytics, allowing additional data (beyond Category, Action and Label) to be included in each data layer event fired from the front end.
38+
39+
- `datasetName`
40+
- `fileType`
41+
- `fileExtension`
42+
- `fileName`
43+
- `releaseName`
44+
- `toolName`
45+
46+
### GTM "Data Layer" Variables
47+
48+
##### Dataset Name
49+
- Used to capture `datasetName` dimension from front end data layer.
50+
- Corresponds to `datasetName` custom dimension in Google Analytics.
51+
52+
##### Event Action
53+
- Used to capture `eventAction` dimension from front end data layer.
54+
- Corresponds to the Action value in a Google Analytics event.
55+
56+
##### Event Label
57+
- Used to capture `eventLabel` dimension from front end data layer.
58+
- Corresponds to the Label value in a Google Analytics event.
59+
60+
##### File Extension
61+
- Used to capture `fileExtension` dimension from front end data layer.
62+
- Corresponds to `fileExtension` custom dimension in Google Analytics.
63+
64+
##### File Name
65+
- Used to capture `fileName` dimension from front end data layer.
66+
- Corresponds to `fileName` custom dimension in Google Analytics.
67+
68+
##### File Type
69+
- Used to capture `fileType` dimension from front end data layer.
70+
- Corresponds to `fileType` custom dimension in Google Analytics.
71+
72+
##### Release Name
73+
- Used to capture `releaseName` dimension from front end data layer.
74+
- Corresponds to `releaseName` custom dimension in Google Analytics.
75+
76+
##### Tool Name
77+
- Used to capture `fileType` dimension from front end data layer.
78+
- Corresponds to `fileType` custom dimension in Google Analytics.
79+
80+
### GTM Triggers
81+
82+
#### Download
83+
- Custom event, listens for events where event name is "Dataset" and event action is "Download".
84+
85+
#### Visualize
86+
- Custom event, listens for events where event name is "Dataset" and event action is "Visualize".
87+
88+
### GTM Tags
89+
90+
#### Download
91+
- Sends "Download" event to Google Analytics when Download trigger is fired.
92+
- Event data includes Category, Action and Label as well as Dataset Name, File Extension, File Name, File Type and Release Name dimensions.
93+
94+
#### Visualize
95+
- Sends "Visualize" event to Google Analytics when Download trigger is fired.
96+
- Event data includes Category, Action and Label as well as Dataset Name, Release Name and Tool Name dimensions.
97+
98+
### Front End Data Layer Event Configuration
99+
100+
```
101+
{
102+
event: "eventName"
103+
eventAction: "eventAction",
104+
eventLabel: "eventLabel",
105+
dimension0: "dimension0Value",
106+
...
107+
}
108+
```
109+
110+
where:
111+
- `event` is the Category value sent to Google Analytics, always "Dataset".
112+
- `eventAction` is the Action value sent to Google Analytics, either "Download" or "Visualize".
113+
- `eventLabel` is the Label value sent to Google Analytics, always the full URL to the file or visualization tool.
114+
- `dimension0` represents a dimension to be included in the event values sent to Google Analytics (eg `datasetName`, `toolName`, `releaseName`).
115+
116+
### Deployment
117+
118+
Currently published to develop, ux-dev, integration, staging.

0 commit comments

Comments
 (0)