Using GameAnalytics (Retention and Monetisation) (Ez mode)

Im getting this error:

14:31:44.409 - AnnotateEvent is not a valid member of ReplicatedStorage
14:31:44.410 - Stack Begin
14:31:44.410 - Script ‘ReplicatedStorage.Analytics.AnalyticsModule’, Line 442 - function ClientInit
14:31:44.411 - Script ‘Players.hisokachan.PlayerScripts.Analytics.LocalScript’, Line 2
14:31:44.411 - Stack End

All I’ve done is make a folder in RepStorage and PlayerScripts and copied the code from the guide. The player script is a local script btw.

Any thoughts?

I was attempting to Initiate the module from Replicated Storage which doesn’t run scripts therefore the module wasn’t running. I fixed this issue by moving my main init script to ServerScriptService

I’m now getting this error several times after I join the game

15:15:28.512 - ReplicatedStorage.Analytics.AnalyticsModule:244: attempt to index nil with ‘Name’
15:15:28.513 - Stack Begin
15:15:28.513 - Script ‘ReplicatedStorage.Analytics.AnalyticsModule’, Line 244 - function AnnotateEvent
15:15:28.515 - Script ‘ReplicatedStorage.Analytics.AnalyticsModule’, Line 141 - function AddToEventQueue
15:15:28.516 - Script ‘ReplicatedStorage.Analytics.AnalyticsModule’, Line 338
15:15:28.517 - Stack End
15:15:28.520 - Maximum event re-entrancy depth exceeded for ScriptContext.Error

By the way, GameAnalytics has a Roblox SDK! You don’t even have to use a custom module!

Its custom SDK doesn’t work last time I checked - at all!

Whenever I’ve used their Roblox SDK it’s worked fine. Are you only testing in Studio? When in Studio requests are sent to the sandbox API, not the production API.

This doesn’t seem to work for me, I get this error message when I try to use RecordTransaction or RecordResource:

Screen Shot 2020-06-15 at 8.24.40 PM

I looked at the source code, and it seems that this is causing the problem:

URL_Events				= "http://api.gameanalytics.com/v2/" .. GameKey .. "/events"

I went to the link and it said this

Screen Shot 2020-06-15 at 8.26.15 PM

Please help, thanks!

Wow! Goodbye, blade and rtrack!

Thanks so much, this will definitely help me out :heart:

Here is a high five for your effort :raised_hand_with_fingers_splayed:

Edit: I will be using this on Infinite Autocorrect and What’s The Word (front-page games). For anybody scrolling by, it works great!

1 Like

Making a seperate reply, because this should get some attention.

You do use spawn, which is inefficient.
I would reccommend something like coroutine.resume(coroutine.create(func()end))?

EDIT: Oop, there are some issues. Anybody know how to solve the “Http 400” error?
Annotation 2020-06-16 082903
Does that after every attempt to send request.

GameAnalytics made an official SDK for Roblox!

Nice tutorial though!

3 Likes

It’s not recommended to use it. It has many critical errors that can disable other functions in other scripts(For example some MarketplaceService stuff)

Anyways, this is pretty nice! Is there any way to send Premium Playtime? I don’t understand http://restapidocs.gameanalytics.com/#event-types

1 Like

I’m just wondering if you could elaborate what you mean by:

How would a script be able to disable a service’s functionality?

Firstly, some stuff randomly errors.

And one example of overwriting other script(s) funtionlity is the MarketplaceService’s function to handling product purchases

Wow thank you so much for making this! I have only one question, how does writing a random string name find a game pass or dev product when recording transactions? Like I could say I have a gamepass that gives free food, and the price is 5000000 robux, so I write, (player, 5000000, but then how would I actually call the gamepass, because writing “Free:Food:Gamepass” isn’t going to do anything as far as I know?)

You don’t call the gamepass, just write the name of it. For better organisation on the GA website, type “Gamepass:Food”, but the data GA receives isn’t directly tied to Roblox, its just recording what you tell it.

Hope that helps.

Thanks for replying!

But what am I supposed to tell it?

Hey, I know this is an old topic but I was wondering a few things.

First off all, thanks @yejoice for making this.

How does the monetization work? I have several products in the same category with different prices? How would it know which one is bought?

Very nice tutorial!
However, you don’t have an inbuilt API for Progression so I am able to track level progression?

Hey there, I am wondering, is there anyway to track local script errors in addition to server scripts? I know clients can spam it but I believe it is worth it for me to have knowledge of what is going on client side.

After using game analytics for awhile for my new game, I have come across an issue. For whatever reason, it is taking about 12 hours for events to load into the graphs. Game analytics has obviously received the events as I have 1000+ incoming events, but it stays that way for about 12 hours, and then shows up in the table. I have set the number in that module to 1, but I don’t think it has anything to do with that. Why is game analytics doing this?