GameAnalytics / GA-SDK-ROBLOX

Repository for GameAnalytics Roblox SDK
MIT License
68 stars 44 forks source link

Add Country Statistics Using New API #69

Closed Sequal32 closed 4 years ago

Sequal32 commented 4 years ago

LocalizationService:GetCountryRegionForPlayerAsync() API Reference

This was introduced in September but I just found out about it today and this could be a really great addition to this!

the1schwartz commented 4 years ago

Our backend should annotate all events with country using the IP address the event was sent from.

Sequal32 commented 4 years ago

The issue is that people from all over the world connects to one ROBLOX server and the request originates from that server, most of the time being based in the US. The country statistics as of now are inaccurate. This new API will get the IP from the client and convert it a country code.

I know the game analytics REST API has an option to forward the client IP but not send a country code, so could it be possible to create a database with IPs originating from each country and sending that to the server to emulate a request coming from the client? Using an access control list could probably help.

I can assist with a pull request if this is viable.

OverHash commented 4 years ago

@the1schwartz To clarify, Roblox recently released some new API (linked in the OP), which allows GameAnalytics to get the country a player is from. This information is useful as developers can see which countries players are playing their game from!

the1schwartz commented 4 years ago

Ok I might to speak to our backend team to alter some code to allow forwarding country code instead of client IP (which is possible at the moment). So if that is possible then I think we can easily add the country to events that way. I will let you know when I get more news on this.

the1schwartz commented 4 years ago

Sorry for the long delay but you haven't been forgotten. The backend team has finally added the needed change to support this feature. I have updated the Roblox SDK (v2.1.7) and all events should now include country code of the player using the LocalizationService:GetCountryRegionForPlayerAsync() function. Let me know if there is any issues with this new feature.