Game Ops
Remote Configs
You can register a callback to be notified when the RemoteConfigs have been updated with values from the server using the function below:
if GameAnalytics:isRemoteConfigsReady(Player.UserId) then
-- the remote configs is ready, add your code here
end
To get values out of a populated Remote Configs use the following methods:
-- Without custom default value (using normal default value)
var value = GameAnalytics:getRemoteConfigsValueAsString(Player.UserId, {
key = "key"
})
-- With custom default value
var valueWithCustomDefaultValue = GameAnalytics:getRemoteConfigsValueAsString(Player.UserId, {
key = "key",
defaultValue = "myDefaultValue"
})
If the specified key is not found in the Remote Configs it will return the default value either “normal ”
or “custom”
default value.
It is possible to get an event on each client when the player’s remote configs have been populated and thereby distribute the configs to each configs to be able to access the configs on the client side.
--LocalScript
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local GameAnalyticsRemoteConfigs = ReplicatedStorage:WaitForChild("GameAnalyticsRemoteConfigs")
local function onConfigurationsPopulated(configurations)
-- do stuff with configurations
end
GameAnalyticsRemoteConfigs.OnClientEvent:Connect(onConfigurationsPopulated)
Read more about remote configs here.
A/B Testing
It is possible to get an event on each client when the player’s A/B testing configs have been populated and thereby distribute the configs to each to be able to access the them on the client side. See the code below:
--LocalScript
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local GameAnalyticsRemoteConfigs = ReplicatedStorage:WaitForChild("GameAnalyticsRemoteConfigs")
local function onConfigurationsPopulated(configurations)
-- do stuff with configurations
end
GameAnalyticsRemoteConfigs.OnClientEvent:Connect(onConfigurationsPopulated)
Read more about A/B testing here.