Using Google Analytics

Decided to post this since when I first tried to use this service on my place the Wiki just didn’t seem to cover it (also req.) How to use the Google Analytics to record the sneaky errors and other bugs that other players may cause when they join your game. So instead of having to ask people to report those bugs for you, why not just look at a more easier solution and look at the errors that come up on GA (or HttpService) doesn’t really matter what you use.

There’s not much to configure and do with it other than statistics and pointing out things that happen in-game. That’s all it can offer for now.

You’ll need to look at this if you haven’t signed up yet. They provide the steps for you so I don’t know why I’m giving steps here: https://www.google.com/analytics/web/provision?et=&authuser=#provision/SignUp/

You’ll probably see something like this:

Just put something like your ROBLOX username under the Account Name and http://www.roblox.com under the Website Name. Industry category can be Games with you want to be exact on all the details with what you’re going to do with this. You can set the reporting time zone to whatever suits you, maybe your current time preferably. Once you fill it in there’s a button called Get Tracking ID under all the Data Sharing Settings which doesn’t really matter. You will see the TOS agreement which no one reads so just click accept. You’ll then come up to this page about Tracking Info:

You’ll see that Tracking ID which is probably the only thing you’ll need from there. So now you’ll need this code in a Script in ServerScriptService:

local GA = require(game:GetService("InsertService"):LoadAsset(153590792).MainModule) GA.Init("UA-########-#")

Be sure to get your Tracking ID and paste it in the GA.Init with the hash tags. So what now? Well that’s pretty much it. Oh, and also make sure HttpService is enabled, don’t forget about that. Be sure to test in ROBLOX Studio by starting up an actual server. Something like this in the output should be appearing in the server:

GA EVENT: Category: [PlaceId-########] Action: [ServerStartup] Label: [none] Value: [0]

And now you can go back to that Google Analytics site and you’ll see something like this quite often.

Of course what you’ll want is to click on the All Web Site Data and go over to Real-Time > Events which is where all the data you want is there.

To get some data in first, start up or join a new server with the Google Analytics script you added in and leave or stay, doesn’t matter. You’ll end up with something that looks like this in the events category usually. It will consist of the PlaceId and the Event Action can be the error of a Script or LocalScript, pretty helpful. If you plan on using this in a server that has lots of players online everyday you will always have CoreGui errors no doubt. The cool thing about this is that it tracks real-time events within the past 30 minutes. Some things to take on what you’ll see often is Visit - when someone joins, and ServerStartup - when a new server instance is created. You don’t need to care about the active users on site since it isn’t entirely accurate at tracking players.

To make sure it is absolutely working and tracking errors, try putting in some LocalScripts or Scripts with intentional errors, or put random stuff in the Developer Console while online like game.Workspace.Terrain:remove() (You’ll get an error as usual)

You will usually get the exact same error output in the Event Action list (You’ll see those dots that shorten it, you can simply mouse over to see the entire thing):

Some of the downsides with finding errors using Google Analytics is that the timeframe for Events is not that long, so actions usually come and go (It would be wise to save errors in something like HttpService) If you want absolutely everything in working condition. There are also some other cool statistics you can play around with that Analytics has to offer, such as which countries did the player come from, city (in US) and even concurring player returns.

If there is anything else that I may have missed or questions/comments about GA please do so. You can find the original guide and other things about it here: http://wiki.roblox.com/index.php?title=GoogleAnalyticsModel

28 Likes

Just a warning as this could happen to a few developers.

If you exceed 10 million visits per month Google will start threatening to shut down your Analytics unless you pay them $150,000.

Once they shut it down the module required in this tutorial has nothing to prevent it from spamming and exceeding the http service limit.

image

(Sorry to bump this but felt it was needed)

32 Likes