All GameAnalytics calls erroring

  1. What do you want to achieve? I want to send information about players to GameAnalytics.

  2. What is the issue? Calls always end in
    Debug/GameAnalytics: Failed Events Call. error: HttpError: ConnectFail Warning/GameAnalytics: Event queue: Failed to send events. (I have HTTP Services enabled)

  3. What solutions have you tried so far? I’ve looked and haven’t found anyone with the same issue.

Here’s my code:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- using wally package
--local GameAnalytics = require(ReplicatedStorage.Packages.GameAnalytics)
-- using rojo or manually copied in
local GameAnalytics = require(ReplicatedStorage:WaitForChild("GameAnalytics"))

GameAnalytics:setEnabledInfoLog(true)
GameAnalytics:setEnabledVerboseLog(true)

GameAnalytics:configureAvailableResourceCurrencies({"Gems"})
GameAnalytics:configureAvailableResourceItemTypes({"Gems", "test"})
GameAnalytics:configureBuild("0.1.0")


GameAnalytics:initServer("hidden", "hidden")

GameAnalytics:addResourceEvent(1, {flowType = GameAnalytics.EGAResourceFlowType.Source, itemType = "test", itemId = "test", amount = 100, currency = "Gems"})

You can try this out by creating your own GameAnalytics project and grabbing your Game ID as well as your Private ID, and putting them in the “hidden” parts of my code. (And enabling HTTP Services)
gameanalyticstest.rbxl (86.3 KB)

Thanks! :slightly_smiling_face:

2 Likes

Did you find a solution for this? I’m experiencing the exact same issue.

Found the issue!

It seems like there is an if-statement that breaks the URL while you’re in Studio. It works in the live game!

Pre-Edit

To fix, go to line 189 in the HttpApi in the GameAnalytics module and comment the line out.

Cheers!

EDIT:

Nevermind, it seems that didn’t fix it either. I misread a print statement and thought it worked, but after checking I realized it didn’t. The important thing to note is that it seems to work in live game, and that I emailed the GameAnalytics support team to notify them about the bug.

3 Likes

Ran into this issue myself and was able to fix it; my solution was related to @Maya70i 's suggestion in the HttpApi library; all I needed to do was change the “http” protocol to “https”; on the latest version of the GameAnalytics SDK, that’s GameAnalytics.HttpAPI, lines 31 and 32

Changed from:

local baseUrl = (RunService:IsStudio() and "http" or http_api.protocol) .. "://" .. (RunService:IsStudio() and "sandbox-" or "") .. http_api.hostName .. "/" .. http_api.version
local remoteConfigsBaseUrl = (RunService:IsStudio() and "http" or http_api.protocol) .. "://" .. (RunService:IsStudio() and "sandbox-" or "") .. http_api.hostName .. "/remote_configs/" .. http_api.remoteConfigsVersion

to:

local baseUrl = (RunService:IsStudio() and "https" or http_api.protocol) .. "://" .. (RunService:IsStudio() and "sandbox-" or "") .. http_api.hostName .. "/" .. http_api.version
local remoteConfigsBaseUrl = (RunService:IsStudio() and "https" or http_api.protocol) .. "://" .. (RunService:IsStudio() and "sandbox-" or "") .. http_api.hostName .. "/remote_configs/" .. http_api.remoteConfigsVersion

The string “http” was simply changed to “https”.

Kind of concerning that GameAnalytics’s API has this error out of the box; hopefully it can be addressed and the SDK can be updated if Roblox is still partnered with GA (@sdk_ga ).

10 Likes