Skip to main content

A/B Testing

GameAnalytics' A/B Testing feature allows you to test different game designs and configurations to see which one performs better.

Setup A/B Testing​

Learn how to set up A/B testing in your game by following the A/B Testing guide.

Retrieve A/B Testing IDs​

After configuring an A/B test in your GameAnalytics dashboard you can retrieve the testing ids with the following methods:

-- the experiment the player was assigned to
local abTestId = gameanalytics.getABTestingId()

-- the variant of the experiment the player was assigned to
local abVariantId = gameanalytics.getABTestingVariantId()

Both return an empty string when the player is not part of a test.

info

Remember that the A/B testing ids are first available when the Remote Configs are ready.

The A/B tests are delivered through the remote configs, so read the ids from the remote configs listener or after isRemoteConfigsReady returns true. Reading them straight after initialization returns empty strings:

gameanalytics.setRemoteConfigsListener(function(self)
print("A/B test id: " .. gameanalytics.getABTestingId())
print("A/B variant id: " .. gameanalytics.getABTestingVariantId())
end)