question

progrematic avatar image
progrematic asked

Getting the Experiment ID and Treatment ID from the Amazon response

Hi everyone, I'm in dire need of some assistance here. I'm trying to get the experiment/treatment IDs from the amazon response, but I see no way of doing that. Is this possible? What I mean is, the Amazon response looks like this: [code] { "applicationKey": "xx", "uniqueId": "xx", "treatments": [{ "experimentName": "Experiment Name Here", "experimentId": 173905, "treatmentId": 266165, "treatmentGroup": "Test", "expirationDate": 1403708443746, "isTestParticipant": true, "factors": [{ "name": "offerID", "value": "10001" }] }] } [/code] As it stands, I have access to the variables within "factors". Is it possible for me to have exposure to the "treatments" variables? Thanks in advance.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

tkoba@amazon avatar image
tkoba@amazon answered
Hi progrematic, Thanks for writing in. Can you let us know how you are calling and retrieving the response from?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

progrematic avatar image
progrematic answered
Sure.

id abTestClient = insights.abTestClient;
[abTestClient variationsByProjectNames:[NSArray arrayWithObject:[NSString stringWithUTF8String:projectName]]
withCompletionHandler:^(id variationSet, NSError *error)
{
id variation = [variationSet variationForProjectName:[NSString stringWithUTF8String:projectName]];
//This is where I get variables from the "offers" set. How can I get access to the "treatments" set here?
NSString* variationVariable = [variation variableAsString:[NSString stringWithUTF8String:variableName] withDefault:@""];
}

Sorry, I don't know how to format text on this forum for code.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

DougM@Amazon avatar image
DougM@Amazon answered
Hello progrematic, This would not be something that we currently have available via our AB Testing SDK, as it would tell our systems which AIVariations to give the client for the purposes of of the experiment. You would only be able to get your variables for your AIVariation for a particular AIVariationSet, if there is a specific reason that you would want this particular use case we can certainly bring the request forward to the appropriate internal team for consideration in a future release of the AB Testing SDK.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

progrematic avatar image
progrematic answered
Okay that's good to know. What I need is for the client to have the ability to recognize when an AB Test is restarted. That is, copied to drafts, and started again. In this case, we would still get the exact same variables, possibly even the same variance, but it's a totally different test. The main thing I would like access to is the TestID. It would be awesome if this could be implemented as a new feature in the future. Thanks for your insight, progrematic
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.