Your Purchasely paywalls already know who to target and where to appear. But what if conversion depends on when you ask? By combining Purchasely placements with ContextSDK’s real-world, on-device context signals, you can surface subscription offers at moments of true receptivity - increasing upgrades while reducing unnecessary interruptions.

Demographics say who, behavior says what - but context decides when.
You can build the perfect Purchasely paywall, design the right plans and still lose conversions if you show it at the wrong moment. The same user can be “not now” while they’re in motion and “I’m ready” a few minutes later - without anything about the user changing.
This article shows how to add that missing “when” layer to Purchasely paywall targeting using ContextSDK’s on-device, real-world context signals.
This collaboration builds on earlier conversations between our teams, including a deep dive Felix Krause did with Purchasely on the Subscription League podcast, where timing, UX and sustainable monetization were already central themes. This integration turns those ideas into something teams can actually ship.
Paywall performance depends on two distinct decisions:
Most teams invest heavily in #1 and underestimate how much #2 changes outcomes.
You likely already know the high-intent moments in your product - the flows where it’s natural to show an upgrade prompt.
A classic “must show” moment: When a user tries to access a premium feature
In those cases, the full paywall experience is usually the right call.
The optional moments (where timing matters most): These are situations where you could ask for an upgrade, but you don’t want to ask every time:
Purchasely models these opportunities as placements - specific locations in the user journey that can trigger different paywalls and rules.
A placement is defined in code and managed in the Purchasely Console.
Purchasely gives you powerful tools to shape exposure:
These work well, but they mostly operate on who the user is and what they’ve done.
Now comes the tricky part.
With multiple placements and frequency limits, the first session often uses up all allowed prompts. Users dismiss while distracted, and later - in calmer, higher-intent moments - cooldown rules block the paywall.
Picture this:
A user installs your app during a rushed moment and dismisses two early prompts. Later that evening, they return in a longer, relaxed session - the moment they’d actually consider upgrading. But the paywall never appears.
Traditional targeting treats both sessions as equal. The user is the same. The placements are the same. But the moment is not.
That’s the missing layer: real-world context.
By analyzing the phone's motion sensor data, ContextSDK can detect what a user is doing right now and whether they're receptive to in-app offers or messages. In other words, this technology identifies the perfect moment when a user is most likely to engage with an app-we call this Moment Monetization.
shouldUpsellContextSDK produces a value called shouldUpsell, indicating whether the current moment is optimal for showing an offer.
You can apply this per placement:
This lets you improve conversion without increasing interruptions.
The integration is straightforward-here's how to combine ContextSDK with Purchasely:
First, integrate ContextSDK into your app. Add it to your project using CocoaPods, Swift Package Manager, or manually:
Then initialize it in your AppDelegate:
The key is to capture the user's context before you show the paywall. Here's a complete example:
Let's break down what's happening:
ContextManager.instantContext(flowName:duration:) - This captures the user's real-world context. The flow name (e.g., "purchasely_onboarding") uniquely identifies this opportunity in your app. Use descriptive names like "purchasely_settings", "purchasely_post_action", etc.Purchasely.setUserAttribute() - This passes the shouldUpsell value to Purchasely as a user attribute. You can then use this in the Purchasely Console to create audience rules-for example, only showing the paywall when context_should_upsell is true. This gives you flexibility to A/B test different strategies without code changes.Purchasely.presentationController(for:) - This is your standard Purchasely integration. The placement ID (e.g., "onboarding") should match what you've configured in your Purchasely dashboard.context.log() - This logs the outcome, which is crucial for training the ML model: .positive - User completed a purchase.negative - User dismissed the paywall.skipped - Paywall wasn't shown, or user restored purchasesYou can use this pattern across multiple placements in your app:
Flow Naming Convention: Use a consistent naming pattern for your flow names. We recommend using snake_case and grouping related flows with the same prefix, e.g.:
purchasely_onboarding_step_1purchasely_onboarding_step_2purchasely_post_levelpurchasely_settingsPlacement Mapping: Your ContextSDK flow names don't need to match your Purchasely placement IDs, but having a clear relationship helps maintain your code. For example:
purchasely_onboarding" → Placement: "onboarding"purchasely_settings" → Placement: "settings"Always Log Outcomes: The ML model learns from the outcomes you log. Make sure to always log one of the three outcomes (.positive, .negative, or .skipped) for every context you capture.
When you first integrate ContextSDK:
context.shouldUpsell always returns true (which gets passed to Purchasely as context_should_upsell = true), allowing you to collect data. You'll need approximately 1,000 positive outcomes (purchases) for the model to be trained.context.shouldUpsell will make real-time decisions about whether it's a good moment, and this decision will be passed to Purchasely where you can use it in your audience rules.When you combine:
…you can improve conversion rates without training users to dismiss prompts.
In practice, ContextSDK X Purchasely helps you:
→ If you're a visual learner, check out this Loom we've recorded which shows all of this in action.
ContextSDK is available for production use. To get started:
If you're not already using Purchasely:
We're selecting partners to co-publish joint case studies showcasing results with ContextSDK × Purchasely. If you'd like to participate and share your success story, reach out to dieter@contextsdk.com and we'll guide you through the next steps.
Contact ContextSDK: dieter@contextsdk.com