Getting my game visit data

Continuing on from Is there a way to collect game visit data?


So today Arsenal reached 1 billion visits (congrats, btw) and I noticed that the number in the top left corner (amount of visits) kept changing, and now that my game is about to reach 1000 visits, I want to do a countdown like that…

The thing is, I’ve never used HttpService and I learned a bit about it but not enough. I looked at the topic at the beginning of this post, but that hasn’t been solved.

Please help! Thanks!

2 Likes

I unfortunately wouldn’t like to spoonfeed you the whole code but I’ll give you an example of how you can retrive your game data from an API

local HttpService = game:GetService("HttpService")
local API_URL = "https://games.roblox.com/v1/games?universeIds=" .. game.GameId -- API that you want to get from
local Data = HttpService:GetAsync(API_URL):JSONDecode()
1 Like

How about use PlayerAdded, MessagingService instead of HtppService. Like everytime a player is added you send a message to all servers and add a value of some sort

You may be able to use Google Analytics, hopefully this is something that can help you.

https://developer.roblox.com/en-us/articles/Using-Google-Analytics

So, will Data be the number of visits (most likely not) or would it be like Data.Visits or something?

Since I never found a solution to this I just let the game reach 1K visits.

Even though I have reached 1K visits, I still need to know how I can collect game visit data.

I’ve tackled this problem in the past. What I found to work best was to create a quick command in my discord bot that returned the game statistics using the Roblox Games API. Then with the JSON all I did was parse through the contents for the stats I wanted.

The most important thing to know about using JSON in data transmission is its hierarchy. Here’s a good article for handling JSON in your code.

Thing is, I literally just got discord and I’m only good in Roblox Lua.

Could you send a link to the bot or something?

It uses the same methods as @T_eethyz for the most part. The only thing you need to know is how to extract the proper information from the JSON.