You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
By migrating to gtag (which is the preferred client of GA), we can
provide seamless integration with GA. This version is stricter in
respecting Do-Not-Track.
Copy file name to clipboardExpand all lines: docs/customization/adding-ga.md
+4-41Lines changed: 4 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,53 +18,16 @@ When you finish, click on `Get Tracking ID` at the bottom of the page:
18
18
19
19

20
20
21
-
This will redirect you to the configuration page where you find the HTML code you need to use in the template:
21
+
This will redirect you to the configuration page where you find the HTML code you'd use in the template:
22
22
23
23

24
24
25
-
**Don't use the snippet above**. Instead, with your favourite code editor, open the file at `Assets/WebGLTemplates/WebVR/index.html` and paste the following code after including the `telemetry.js` library, preferably at the bottom of the `<head>` tag:
26
-
27
-
```html
28
-
<script>
29
-
var ga =MozillaResearch.telemetry.ga.create('UA-XXXXXXX-Y');
30
-
ga('send', 'pageview');
31
-
</script>
32
-
```
33
-
34
-

35
-
36
-
### Template integration of Google Analytics
37
-
38
-
If you have used Google Analytics before, the previous code should remind you of the familiar Analytics snippet:
39
-
40
-
```js
41
-
ga('create', 'UA-XXXXXX-Y', 'auto');
42
-
ga('send', 'pageview');
43
-
```
44
-
45
-
When using Analytics inside the template, use the `create` method of `MozillaReasearch.telemetry.ga` instead of the `create` command. It will return a tracking function which can be used in the same way you would use it in the guide [Sending Data to Google Analytics](https://developers.google.com/analytics/devguides/collection/analyticsjs/creating-trackers).
46
-
47
-
```js
48
-
var ga =MozillaResearch.telemetry.ga.create('UA-XXXXXX-Y', 'auto');
49
-
ga('send', 'pageview');
50
-
```
51
-
52
-
If you want to customize the way you create the tracker, read [Creating Trackers](https://developers.google.com/analytics/devguides/collection/analyticsjs/creating-trackers) and remember that:
53
-
54
-
```js
55
-
ga('create', arg1, arg2, ...);
56
-
```
57
-
58
-
Is equivalent to:
59
-
60
-
```js
61
-
var ga =MozillaResearch.telemetry.ga.create(arg1, arg2, ...);
62
-
```
25
+
Add the snippet just after the `<head>` tag and you'll be ready to go.
63
26
64
27
## Using Google Analytics
65
28
66
-
The amount of data in Google Analytics can be overwhelming to navigate and dissect. Fortunately, the folks at Google have developed a series of courses to explain you the main concepts of traffic analysis. We recommend you start at [Google Analytics Academy](https://analytics.google.com/analytics/academy/).
29
+
The amount of data in Google Analytics can be overwhelming to navigate and dissect. Fortunately, the folks at Google have developed a series of courses to explain you the main concepts of traffic analysis. We recommend you start at [Google Analytics Academy](https://analytics.google.com/analytics/academy/).
67
30
68
31
## Open-source alternatives
69
32
70
-
There are a few [open-source alternatives](https://en.wikipedia.org/wiki/List_of_web_analytics_software#Free_/_Open_source_(FLOSS)) out there. Like Google Analytics, they are free although you need to host them yourself. We recommend [Matomo](https://matomo.org/) and [Open Web Analytics](http://www.openwebanalytics.com) (OWA). Both offer geolocation, click-heat maps, traffic by referrer, event tracking, etc. Which specifically depends on your needs but you can compare both side by side visiting the [demo pages for Matomo](https://demo.matomo.org) and [OWA](http://demo.openwebanalytics.com/owa/).
33
+
There are a few [open-source alternatives](https://en.wikipedia.org/wiki/List_of_web_analytics_software#Free_/_Open_source_(FLOSS)) out there. Like Google Analytics, they are free although you need to host them yourself. We recommend [Matomo](https://matomo.org/) and [Open Web Analytics](http://www.openwebanalytics.com) (OWA). Both offer geolocation, click-heat maps, traffic by referrer, event tracking, etc. Which specifically depends on your needs but you can compare both side by side visiting the [demo pages for Matomo](https://demo.matomo.org) and [OWA](http://demo.openwebanalytics.com/owa/).
0 commit comments