Promotion APIs for A/B Testing

You can use the Salesforce B2C Commerce APIs for when a promotion is assigned to an A/B test and not to a campaign. These classes return a placeholder campaign, representing A/B tests, for API methods that return or process a campaign instance, when an A/B test (not a campaign) is in effect.

When a promotion or price adjustment is the result of an A/B test, these methods return the following:

With this method... Returns...
Promotion.getCampaign placeholder campaign
Promotion.getCoupons empty collection
Promotion.getCustomerGroups empty collection
Promotion.getSourceCodeGroups empty collection
Promotion.isBasedOnCoupon false
Promotion.isBasedOnCoupons false
Promotion.isBasedOnCustomerGroups false
Promotion.isBasedOnSourceCodes false
PriceAdjustment.getCampaign placeholder campaign
PriceAdjustment.getCampaignID ID of placeholder campaign
PriceAdjustment.getCouponLineItem null
PriceAdjustment.isBasedOnCampaign true
PriceAdjustment.isBasedOnCoupon false

Related Links

APIs for Promotions

A/B Testing

The B2C Commerce API documentation

X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. By continuing to use this site you are giving us your consent to do this.