Skip to main content
Question

Experimets


Forum|alt.badge.img+3

In my app I sell subscription and consumable in-app purchase packages. In the app my default offer includes subscription packages. I’m fetching my in-app purchase packages with hardcoded offer id like “default_credit_offer” and I want to make experiments for default_credit_offer but I haven’t found the solution for that issue can you help me for that. Is revenue cat support this situation?

3 replies

Forum|alt.badge.img
  • RevenueCat Staff
  • 8 replies
  • June 25, 2025

Hi Harun!

Nice to meet you, I’m Víctor and I will help you with this case. In order to gather more context, I’d like to ask you some questions:

I believe you’re trying to test two offerings, which is totally supported by RevenueCat. However, you are fetching Offerings by their ID from the code itself, which limits your capacity to run Experiments. Could you please confirm if I’ve understood your issue correctly?

If that’s the case, could I learn more about the logic you are using for your code, please? Without any further context, I would advise to pair this experiment with a Paywall so we can dynamically display the right Offering.

 

Best,

-Víctor from RevenueCat


Forum|alt.badge.img+3
  • Author
  • New Member
  • 1 reply
  • June 26, 2025

Hi vpezer, 

                if let firstPaywallOffer = offerings?.current {
                    self.firstPaywallPackages = firstPaywallOffer
                        .availablePackages.map({ $0.storeProduct })
                }
                if let coinPaywallOffer = offerings?["new_credit_offer"] {
                    self.coinPaywallPackages = coinPaywallOffer
                        .availablePackages.map({ $0.storeProduct })
                }

This is my fetching offerings code firstPaywall is a subscription paywall, coinPaywall is a consumable in-app purchase packages paywall. I can make experiments easily on firstPaywallOffer because experiments make changes on current offering when I want to make experiments on coinPaywall offer.My expectation is that when I try to read the offer with the id new_credit_offer from these offerings, some users will receive the test offer and some will receive the new_credit_offer itself, so that I can experiment on new_credit_offer, but unfortunately this does not work. When it comes to using the Paywalls feature, we code the paywalls ourselves, we do not prefer to use RevenuecatUI, so it does not seem possible for us to use the Paywalls feature.


Forum|alt.badge.img
  • RevenueCat Staff
  • 8 replies
  • July 3, 2025

Hi Harun,

Hope you’re doing great! Thanks for the code snippet and the additional context, they help a lot.

Hardcoding offering identifiers won’t work for experiments, as we require to always use the current offering when you want to perform A/B testing.

The only way to change the current offering “pointer” in your case would be to use Placements, as Paywalls are off the table. With Placements, you can define identifiers for certain parts of your app (i.e. when a customer wants to purchase a subscription or when they want to purchase some coins) and automatically tell RevenueCat to modify the current offering based on it.

So, in your case, you would need to:

1- In the RevenueCat dashboard, navigate to Targeting > New Rule

2- Define your custom rule and create a placement with a name of your choice (i.e. “new_credit_offer”)
 

 

3- Modify your code to display the right offering based on your placements:

if let firstPaywallOffer = offerings.currentOffering(forPlacement: "first_paywall_offer") {
   self.firstPaywallPackages = firstPaywallOffer
      .availablePackages
      .map { $0.storeProduct }
}

if let coinPaywallOffer = offerings.currentOffering(forPlacement: "new_credit_offer") {
   self.coinPaywallPackages = coinPaywallOffer
      .availablePackages
      .map { $0.storeProduct }
}

4- Create an Experiment and use the Placements you just created:

 

With this, you would be able to test your Offerings dynamically. Please let me know if this solved your question! I’ll be happy to help if you have any follow-up doubts.

 

All the best,

-- Víctor from RevenueCat


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings