Guess I found another bug. Swift SDK doesn't use c...
# sdk-swift
l
Guess I found another bug. Swift SDK doesn't use custom variation IDs in the experiments. Example 1 with default variation IDs:
Copy code
"variations": [0, 1, 2],
          "weights": [0.8, 0.1, 0.1],
          "key": "map_timeline_bubble",
          "meta": [
            {
              "key": "0",
              "name": "Control"
            },
            {
              "key": "1",
              "name": "v1"
            },
            {
              "key": "2",
              "name": "v2"
            }
          ],
Example 2 with changed variation IDs:
Copy code
"variations": [0, 1, 2],
          "weights": [0.8, 0.1, 0.1],
          "key": "ios-map-timeline-mini-bubble-copy",
          "meta": [
            {
              "key": "3",
              "name": "Control"
            },
            {
              "key": "4",
              "name": "v1"
            },
            {
              "key": "5",
              "name": "v2"
            }
          ],
In the callback, in both cases I see only
0,1,2
variations.
How it could be changed in the GB web:
p
Hi @late-ambulance-66508 Looked into this - it's actually working as intended per the GrowthBook SDK spec.
variationID
- The array index of the assigned variation. So it will always return 0, 1, 2, regardless of custom IDs. The custom ID from meta is available via the
key
field - The unique key for the assigned variation. Confirmed locally: with custom IDs set to 3, 4, 5, the result returned:
variationId: 2 and key: 5.
So in your
trackingCallback
, use:
result.key
instead of
result.variationId
to get custom variation ID Docs reference: https://docs.growthbook.io/lib/build-your-own#experimentresult
l
Got it, but there is inconsistency with experiment results UI, it shows that it expects changed variation ids
Thanks! Will change our implementation