Screen Targeting
Scope Digia Engage campaigns to specific app screens — how setCurrentScreen works, how to report the current screen, and which campaign types honor screen targeting.
1. Why it's useful
2. Report the current screen
import { Digia } from '@digia-engage/core';
navigationRef.addListener('state', () => {
const routeName = navigationRef.getCurrentRoute()?.name;
if (routeName) Digia.setCurrentScreen(routeName);
});import com.digia.engage.Digia
import com.digia.engage.digiaScreen
// Compose (or anywhere):
Digia.setCurrentScreen("checkout")
// View / XML — from the screen's onResume():
override fun onResume() {
super.onResume()
digiaScreen("checkout")
}import DigiaEngage
// Manual:
Digia.setCurrentScreen(name: "checkout")
// From a view controller:
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
digiaScreen("checkout")
}3. Names must match the dashboard exactly
4. What screen targeting applies to
Campaign type
Behavior with screen targeting
5. How matching resolves
6. Use it correctly
Related pages
Last updated