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.
Copy file name to clipboardExpand all lines: README.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,13 @@ Reach out to us with any questions you may have or help you may need, and partic
74
74
75
75
*[Join the WebVR Slack](https://webvr.rocks/slack) (join the [#unity channel](https://webvr.slack.com/messages/unity))
76
76
77
+
## Developer Privacy Notice for Data Collection
78
+
79
+
To help improve the WebVR API and the WebVR Export assets, Mozilla automatically receives technical, interaction, and error data of end users, using [Sentry](https://sentry.io) and [Google Analytics](https://analytics.google.com/analytics/web/). For example, this includes number of times VR device is mounted and worn; number of times VR mode is enabled and time spent; time for webpages to load and time open; and a unique browser identifier.
80
+
81
+
Developers can turn off this data collection by [modifying the configuration snippet that comes with the VR template](./docs/customization/disabling-telemetry.md).
82
+
83
+
End users can turn off this data collection by enabling [`Do-Not-Track`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/DNT) in their browsers.
Copy file name to clipboardExpand all lines: docs/customization/adding-ga.md
+39-4Lines changed: 39 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
3
Google Analytics is a popular web analytics service that tracks and reports website traffic. It offers insight about your user behaviour and allows you to make informed decisions regarding the evolution of your site.
4
4
5
-
You will need to modify the [VR template](../../Assets/WebGLTemplates/WebVR/index.html) that comes with the package, so be sure you've already added [the package from the store](https://u3d.as/1476) to your Unity project.
5
+
The [VR template](../../Assets/WebGLTemplates/WebVR/index.html) that comes with the [Unity package](https://u3d.as/1476) already includes Analytics as a part of the telemetry library used for [collecting usage data](../data-collection.md) but you'll need to set up a Google Analytics account and get a [tracking Id](https://support.google.com/analytics/answer/7372977) first, before using it.
6
6
7
-
## Set up
7
+
## Quick set up
8
8
9
9
Start by visiting [Google Analytics](https://analytics.google.com/analytics/web) and sign up for a new account:
10
10
@@ -22,9 +22,44 @@ This will redirect you to the configuration page where you find the HTML code yo
22
22
23
23

24
24
25
-
Now, in your project, with your favourite code editor, open the file at `Assets/WebGLTemplates/WebVR/index.html` and paste the code provided by Google Analytics inside, preferably at the top of, the `<head>` tag:
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
26
27
-

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, ...);
The code enabling telemetry data collection is in the VR template that comes with the package. Ensure you've already added [the package from the store](https://u3d.as/1476) to your Unity project and look for the following snippet inside the [`index.html` file](../../Assets/WebGLTemplates/WebVR/index.html) of the template:
4
+
5
+
```js
6
+
MozillaResearch.telemetry.start({
7
+
analytics:true,
8
+
errorLogging:true,
9
+
performance:true
10
+
});
11
+
```
12
+
13
+
By default, collecting number of visits, error logs and some performance measurements is enabled by setting the proper options (`analytics`, `errorLogging` and `performance` respectively) to `true`.
14
+
15
+
To prevent the template from sending such information, set the corresponding options to `false`:
0 commit comments