Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit ab86a31

Browse files
authored
Merge pull request #137 from delapuente/issue-108-document-hwo-to-add-ga
Add customization section with instructions to configure GA
2 parents 629f180 + 5d4e091 commit ab86a31

File tree

9 files changed

+38
-0
lines changed

9 files changed

+38
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ This asset works by utilizing Unity's WebGL platform support and therefore share
4242
* [Troubleshooting and FAQ](./docs/troubleshooting-faq.md)
4343
* [Controllers and input system](./docs/controllers.md)
4444

45+
## Customize the template
46+
47+
* [Adding Google Analytics to your game](./docs/customization/adding-ga.md)
4548

4649
## Need help?
4750

docs/customization/adding-ga.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# How to add Google Analytics to your game
2+
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+
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.
6+
7+
## Set up
8+
9+
Start by visiting [Google Analytics](https://analytics.google.com/analytics/web) and sign up for a new account:
10+
11+
![Summary of the three steps to setup Google Analytics](./images/setup-ga.png)
12+
13+
Fill in the details of your organization and website. Remember to select `https://` in the drop-down menu of the `Website URL` field.
14+
15+
![Account and website names, website URL, industry classifications and reporting timezone](./images/filled-1.png)
16+
17+
When you finish, click on `Get Tracking ID` at the bottom of the page:
18+
19+
![Buttons Get Tracking ID and Cancel at the bottom of the page](./images/filled-2.png)
20+
21+
This will redirect you to the configuration page where you find the HTML code you need to use in the template:
22+
23+
![The configuration page includes the instructions for setting up your site](./images/setup-done.png)
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:
26+
27+
![The code provided by GA should be added right after the head tag](./images/add-to-index.png)
28+
29+
## Using Google Analytics
30+
31+
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/).
32+
33+
## Open-source alternatives
34+
35+
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/).
91.9 KB
Loading
36.1 KB
Loading
55.5 KB
Loading
37.3 KB
Loading
69.3 KB
Loading
39.1 KB
Loading
63.3 KB
Loading

0 commit comments

Comments
 (0)