question

liadg avatar image
liadg asked

Segments - How can I know if the user is not in the segment on client side?

I defined an AB testing with a segment. I saw that users which are not in the segment I defined are getting the values of the control group. How can I difference in client side between users which are not in the proper segment and user which is in the segment and got the conrol group? Thanks, Liad
10 |5000

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

1 Answer

Sujoy@Amazon avatar image
Sujoy@Amazon answered
In order to take advantage of the segment you have defined on distribution portal, you must assign a dimension to the user in your app. // Get information from an external source (i.e., preferences dialog). int userId = preferenceDlg.getUserId(); // Set dimensions via AIUserProfile API. UserProfile userProfile = instance.getUserProfile(); userProfile.addDimensionAsNumber("user_id", userId); When the Insights SDK requests a variation for an A/B test, it passes the current values of all assigned dimensions for that user. Only users whose dimensions pass all segment filters are included in the A/B test. When a A/B test starts, the dimensions at that time will be evaluated to determine the variation the user is assigned. Please follow below documentation for more information. https://developer.amazon.com/public/apis/manage/ab-testing/doc/segmentation... Let's assume you have Variation A and Variation B in your A/B test. In order to verify the users not in the Segment don’t Receive the A/B Test please change the UserProfile user_id dimension in your app’s code so that the user_id is no longer between 1 and 100. Leave the allocation of Variation B at 100%. Clear your app's data to ensure that you don't use any cached variations from the previous step. Since the user_id dimension is no longer a part of the segment, you should not receive Variation B. Instead, you should receive a variation with all the same variables as Variation A (Control). Note that even though you received a variation with Control variables, the view and conversion events are not counted in the A/B test. Please refer below doc for end to end testing for A/B testing integration in your app https://developer.amazon.com/public/apis/manage/ab-testing/doc/end-to-end-t... If you still face issue with segments, please send your code through ContactUs ( https://developer.amazon.com/help/contactus.html ) along with the test configuration details. Thanks.
10 |5000

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