Event Action Configuration
49 min
configuration guide for event actions through the experience builder each action type has specific properties that can be configured to customize behavior in your application actions navigate action navigates users to another view within the storefront properties type string required must be set to "navigate" path string optional path to navigate to (ignored if url is set) url string optional complete url to navigate to params object optional url parameters to include mergeparams boolean optional whether to merge with existing url parameters replaceurl boolean optional whether to replace the current url in browser history statuscode number optional http status code (only affects server side rendering) example { "type" "navigate", "path" "/articles", "params" { "category" "news" }, "replaceurl" false } open content action opens purple content issues, articles, or bundles properties type string required must be set to "opencontent" fallback eventactionconfig optional action to perform if content cannot be accessed limit number optional maximum number of issues to include in pager pageindex number optional page index to open the initial issue on elementalias string optional element alias to jump to in the initial issue issueid string optional specific issue id to open bundle object optional bundle configuration bundleid string required id of the bundle to open postid string optional specific post id within the bundle opencollection object optional collection display configuration (deprecated) taxonomyid string optional taxonomy id for dynamic url generation taxonomytype string optional taxonomy type for dynamic url generation titlebar boolean optional whether to show the native title bar example { "type" "opencontent", "issueid" "article 123", "titlebar" true, "limit" 10, "pageindex" 1 } popup action opens a storefront view as a popup overlay properties type string required must be set to "popup" path string required path to the view to open in popup params object optional parameters to pass to the popup view animation string optional animation type "slide in" or "pop up" example { "type" "popup", "path" "/subscription details", "animation" "slide in", "params" { "planid" "premium" } } login action opens the login view for user authentication properties type string required must be set to "login" params object optional parameters to pass to the login view replaceurl boolean optional whether to replace the current url example { "type" "login", "params" { "returnurl" "/premium content" }, "replaceurl" false } logout action logs out the current user properties type string required must be set to "logout" confirm boolean optional whether to show a confirmation dialog example { "type" "logout", "confirm" true } external login action performs authentication through an external service properties type string required must be set to "externallogin" url string required url of the external login service params object optional additional parameters for the url callbackparamname string optional name of callback parameter default "callbackurl" assignlocalpurchases string optional how to handle local purchases during login accountidparamname string optional parameter name for account id default "userid" entitlementparamnames object optional entitlement login configuration usernamekey string username parameter key (default "username" ) passwordkey string password parameter key (default "password" ) accountidfromentitlement boolean use account id from entitlement token onsuccess eventactionconfig required action to perform after successful login oncancel eventactionconfig optional action to perform if login is cancelled onstart eventactionconfig optional action to perform when login starts closeonmodalcancel boolean optional whether to close modal on cancel example { "type" "externallogin", "url" "https //auth example com/login", "callbackparamname" "callback", "onsuccess" { "type" "navigate", "path" "/dashboard" } } register action opens the user registration view properties type string required must be set to "register" params object optional parameters to pass to the registration view example { "type" "register", "params" { "plan" "premium" } } open url action opens an external url in a browser or specified target properties type string required must be set to "openurl" url string required url to open target string optional target window/tab (e g , " blank" , " self" ) params object optional additional parameters example { "type" "openurl", "url" "https //support example com", "target" " blank" } purchase action initiates a one time purchase of a product properties type string required must be set to "purchase" productid string required id of the product to purchase price number required price of the product currency string required currency code (e g , "usd" , "eur" ) showerrordialog boolean optional show error dialog on failure default true onsuccess eventactionconfig optional action to perform after successful purchase consumeoptions object optional options for repeatable purchases example { "type" "purchase", "productid" "article unlock 123", "price" 2 99, "currency" "usd", "showerrordialog" true, "onsuccess" { "type" "opencontent", "issueid" "article 123" } } subscribe action initiates a subscription to a recurring product properties type string required must be set to "subscribe" productid string required id of the subscription product price number required price of the subscription currency string required currency code showerrordialog boolean optional show error dialog on failure default true onsuccess eventactionconfig optional action after successful subscription upgrademode string optional upgrade behavior "immediate with time proration" immediate upgrade with time based proration "immediate and charge prorated price" immediate upgrade, charge price difference "immediate without proration" immediate upgrade, no proration "deferred" upgrade only when subscription renews offerid string optional promotional offer id (ios only) example { "type" "subscribe", "productid" "premium monthly", "price" 9 99, "currency" "usd", "upgrademode" "immediate with time proration", "onsuccess" { "type" "navigate", "path" "/premium dashboard" } } restore purchases action restores previously purchased items (ios only) properties type string required must be set to "restorepurchases" onsuccess eventactionconfig optional action to perform after restoration confirm boolean | string optional show confirmation dialog or custom message example { "type" "restorepurchases", "confirm" "are you sure you want to restore your purchases?", "onsuccess" { "type" "navigate", "path" "/my content" } } subscriptions action opens the subscriptions management view properties type string required must be set to "subscriptions" params object optional parameters to pass to the subscriptions view example { "type" "subscriptions", "params" { "tab" "active" } } coupon action opens the coupon redemption view properties type string required must be set to "coupon" params object optional parameters to pass to the coupon view example { "type" "coupon", "params" { "prefilledcode" "welcome2024" } } set user attribute action sets a custom attribute for the current user properties type string required must be set to "setuserattribute" key string required attribute key/name value string required attribute value onfinished eventactionconfig optional action to perform after setting the attribute example { "type" "setuserattribute", "key" "preferred language", "value" "en", "onfinished" { "type" "navigate", "path" "/personalized content" } } delete all bookmarks action removes all user bookmarks properties type string required must be set to "deleteallbookmarks" confirm boolean optional whether to show confirmation dialog example { "type" "deleteallbookmarks", "confirm" true } set context variables action sets context variables that can be used throughout the application properties type string required must be set to "setcontextvariables" variables array required array of variable objects each object contains key string required variable name value string required variable value example { "type" "setcontextvariables", "variables" \[ { "key" "theme", "value" "dark" }, { "key" "region", "value" "europe" } ] } multi action executes multiple event actions in sequence important actions must not rely on each other! important actions must not use context information being changed in one of the actions each action in the sequence executes independently and should not depend on the results or side effects of previous actions in the same multi action configuration use cases \ store user data, then navigate to a new page \ set user preferences, then open content \ log analytics events, then perform navigation properties type string required must be set to " multiaction " actions array required list of actions to execute in sequence array of eventactionconfig objects example { "type" "multiaction", "actions" \[ { "type" "setuserattribute", "key" "last viewed", "value" "premium content" }, { "type" "opencontent", "issueid" "article 123" }, { "type" "navigate", "path" "/reading history" } ] } remarks configuration patterns action chaining many actions support callback properties that allow chaining actions together onsuccess execute after successful completion onfinished execute after any completion oncancel execute if action is cancelled { "type" "purchase", "productid" "premium article", "price" 1 99, "currency" "usd", "onsuccess" { "type" "opencontent", "issueid" "premium article 123" } } conditional values some properties support conditional values that change based on application state or user properties these require developer configuration parameters usage the params object allows passing additional data navigation parameters for url generation view specific configuration options form pre population data best practices testing always test configurations in development before production user experience use confirmation dialogs judiciously for destructive actions pricing ensure currency and pricing match app store configuration urls verify all paths work correctly in your application setup product ids must match configured in app purchases exactly