Skip to content

Latest commit

 

History

History
35 lines (18 loc) · 2.64 KB

adding-ga.md

File metadata and controls

35 lines (18 loc) · 2.64 KB

How to add Google Analytics to your game

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.

The XR template that comes with the Unity package already includes Analytics as a part of the telemetry library used for collecting usage data but you'll need to set up a Google Analytics account and get a Tracking ID first, before using it.

Quick set up

Start by visiting Google Analytics and sign up for a new account:

Summary of the three steps to setup Google Analytics

Fill in the details of your organization and website. Remember to select https:// in the drop-down menu of the Website URL field.

Account and website names, website URL, industry classifications and reporting timezone

When you finish, click on Get Tracking ID at the bottom of the page:

Buttons Get Tracking ID and Cancel at the bottom of the page

This will redirect you to the configuration page where you find the HTML code you'd use in the template:

The configuration page includes the instructions for setting up your site

Copy and paste this code as the first item into the <head> tag.

Read Google Analytics' "Sending Data" documentation to learn how to use the gtag API.

Using Google Analytics

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.

Open-source alternatives

There are a few open-source alternatives out there. Like Google Analytics, they are free although you need to host them yourself. We recommend Matomo and Open Web Analytics (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 and OWA.