# Actions for in-app experiences

Actions determine what happens when a user interacts with your In-App Automations and Scenes.

You must set actions for all buttons in In-App Automations and Scenes. You can also set actions for text, images, and screens in Scenes.

> **Note:** For actions for other message types, see [Actions](https://www.airship.com/docs/guides/messaging/messages/actions/).


## Configuring actions

You can configure actions in two locations:

* For [In-App Automations using the WYSIWYG editor](https://www.airship.com/docs/guides/messaging/in-app-experiences/in-app-automation/create/#content) and for all Scenes, you add buttons and set actions in the composer's Content step.

* For [In-App Automations using the Classic design method](https://www.airship.com/docs/guides/messaging/in-app-experiences/in-app-automation/create/#content), you add buttons in the Content step and set their actions in the Actions step. 

For each button or Scene text, image, or screen:

1. Select and configure an [action](#actions) and its [Web URL](#web-fallback-url).

1. (Optional, for Scenes only) Determine how the Scene behaves, and/or specify an event name for tracking, when the button, text, image, or screen is clicked/tapped.

   See [Action: Scene behavior and Action: Event name](https://www.airship.com/docs/guides/messaging/in-app-experiences/configuration/content/#button-or-button-group) for Button or Button Group in *Configuring Scene content*. The same information is also listed for the Text and Media elements, and the information also applies to actions for screens. **An event name is required when setting an action for an image or screen.**

   For usage examples, see [Using actions with Scene behaviors](#using-actions-with-scene-behaviors).

1. (Optional) Set and/or remove [Tags](https://www.airship.com/docs/reference/glossary/#tag) and/or opt a user in to or out of a [Subscription List](https://www.airship.com/docs/reference/glossary/#subscription_list) when the user taps the button, text, image, or screen. See [Options](#options) below.
1. (Optional, for In-App Automation buttons only) Limit the message display to once if the user taps the button. Check the box to enable.
   > **Tip:** Use this for repeated goal-related messages such as prompting to opt in. You would want to prevent re-display when the user accomplishes the goal.


Repeat for each button in the message. For In-App Automation, select **Design 
** to move on to the next composer step.

### Using actions with Scene behaviors

For buttons and text links in Scenes, in addition to an action, you can determine how the Scene behaves when the button or link is tapped. These examples combine actions with Scene behavior settings:

   * **Give the option "Don't ask me again"** — How to set it up: For a Scene configured to repeat, label a button `Don't ask me again` and set the Scene behavior to *Dismiss and cancel repeat*.
   
   * **Close the Scene in the background while the system opt-in prompt is in the foreground** — How to set it up: For a button configured with the action *Subscription List Opt In/Out* or *Push Opt-in*, set the Scene behavior to *Dismiss*.
   
   * **Advance to the next screen after opting in, without requiring a swipe** — How to set it up: For a button configured with the action *Subscription List Opt In/Out* or *Push Opt-in*, set the Scene behavior to *Next screen*.

### Web fallback URL

For Scenes with both App and Web channels selected, these actions apply to mobile apps only:

* App Rating
* App Settings
* Deep Link
* Preference Center
* Share

When configuring the actions, enter a URL in **Web URL** as an alternative behavior. Selecting the button or text opens a web page or any valid device-level URL such as App Store or app protocol links. The web page opens in the device’s default browser.

## Actions

Supported actions and options per composer:

| Actions | In-App Automation — Button<sup>1</sup> | Scene — Button/Media/Screen (App) | Scene — Button/Media/Screen (Web) | Scene — Text |
| --- | :---: | :---: | :---: | :---: |
| Adaptive Link | &#10003; | &#10003; | &#10003; | &#10003; |
| App Rating | &#10003; | &#10003; |  |  |
| App Settings |  | &#10003; |  |  |
| Deep Link | &#10003; | &#10003; |  | &#10003; |
| Dismiss Message | &#10003; | &#10003; | &#10003; |  |
| Location Opt-in | &#10003; | &#10003; |  |  |
| Next |  | &#10003; | &#10003; |  |
| Preference Center | &#10003; | &#10003; |  |  |
| Previous |  | &#10003; | &#10003; |  |
| Push Opt-in | &#10003; | &#10003; | &#10003; |  |
| Share | &#10003; | &#10003; |  |  |
| Submit Responses |   | Button and Media only | Button and Media only |  |
| Validate Form |   | &#10003; | &#10003; |  |
| Web Page | &#10003; | &#10003; | &#10003; | &#10003; |
| Option: Emit a Custom Event |  | &#10003; | &#10003; |  |
| Option: Set Tags | &#10003; | &#10003; | &#10003; |  |
| Option: Subscription List Opt In/Out | &#10003; | &#10003; | &#10003; |  |

<sup>1. Footer buttons support these actions only: Adaptive Link, Deep Link, Web Page.</sup>

### Adaptive link

<p><em>Adaptive Link</em> opens a mobile wallet pass. Select an [Adaptive Link](https://www.airship.com/docs/reference/glossary/#adaptive_link) from the list.</p>
<ul>
<li>Adaptive links must be configured before they will appear in the actions list. See: <a href="https://www.airship.com/docs/guides/wallet/user-guide/create-links/dashboard/">
Create adaptive links using the dashboard</a>.</li>
<li>Only adaptive links created in the dashboard will appear in the actions list.</li>
</ul>

### App Rating

<p><em>App Rating</em> prompts the user to rate the app in the app store. Optionally enter a custom message title and body.</p>
> **Note:** **App Rating display behavior differs by operating system:**
> 
> * The Title and Body dialog appear for Android only.
> * iOS displays its system dialog for app rating. Additionally,
> [Apple limits app rating dialogs to three times in a 365-day period](https://developer.apple.com/app-store/ratings-and-reviews/).
> 
> App rating prompts will process as configured by your message settings, but the displayed dialog is controlled by Apple, not Airship.

> **Important:** iOS requires that you provide your app's Apple ID, which is used as the iTunes App Store Identifier. (Android and Fire OS generate app store links automatically based on information already in your app, so no configuration is required.)
> 
> You can do this by [adding the ID in your Airship project settings](https://www.airship.com/docs/guides/messaging/project/config/itunes-id/), or by editing your plist dictionary.
> 
> In your plist dictionary, add the following, substituting `1111111111` with the app's actual ID:
> ```text
> <key>itunesID</key>
> <string>1111111111</string>
> ```
> 
> 
> A quick way to find the Apple ID is to copy the numbers at the end of the app's App Store URL. If the URL is `https://apps.apple.com/app/id1195168544`, the Apple ID is `1195168544`.
> 
> Another way is to locate your app in [iTunes Connect](https://itunesconnect.apple.com/) and copy the Apple ID.

### App Settings

*App Settings* opens the device's settings page for the app.

### Deep Link

<p><em>Deep Link</em> opens a screen in your app or website. Select a deep link from the list.</p>
<ul>
<li>Deep links must be configured before they will appear in the actions list. See: <a href="https://www.airship.com/docs/guides/messaging/project/config/deep-links/">Manage Deep Links</a>.</li>
<li>If you selected a <a href="#deep-link-templates">deep link template</a>, fill in each template segment.</li>
</ul>

#### Deep Link templates {#deep-link-templates}

<p>Our Deep Link functionality supports URL templates, which expose a friendly interface to your users in our UI, while constructing the correct URL behind the scenes on the fly. You can specify substitution parameters by enclosing them in brackets. For example, if you want to define a Deep Link for a product page screen in your app (or on your mobile website), you can make the product ID number a substitution parameter. Here are example template URLs:
```text
https://yourcompany.com/products/{Product Id}

yourapp://products/{Product Id}
```
</p>
<p>When you enter this URL in the Airship interface, the form parses it and previews the form your users see in the composer. It automatically identifies &ldquo;Product Id&rdquo; as the parameter name, and provides a field to substitute in the actual identifier. So if you had previously entered a product ID of 1872983490 for the above Product ID, the generated URL would be:
```text
http://yourcompany.com/products/1872983490

yourapp://products/1872983490
```
</p>
<p>The interface treats all values for each field as a string.</p>

### Dismiss Message

*Dismiss Message* closes the message.

### Location Opt-in

*Location Opt-in* opens the system prompt for location opt-in.

### Next

*Next* opens the next screen in a Scene.

### Preference Center

<p><em>Preference Center</em> opens an <a href="https://www.airship.com/docs/guides/messaging/features/preference-centers/">app preference center</a>. Select a preference center from the list.</p>

### Previous

*Previous* opens the previous screen in a Scene.

### Push Opt-in

*Push Opt-in* prompts users to enable push notifications. When a user taps the screen element configured with this action, the system behavior depends on the current permission status and platform.

**Mobile app behavior:**

<ul>
<li><strong>Permission already granted</strong>: No prompt appears. The user continues in the app without interruption because iOS and Android do not allow re-prompting for permissions that are already granted.</li>
<li><strong>Permission not yet decided</strong>: The system permission prompt appears, allowing the user to grant or deny push notification access.</li>
<li><strong>Permission previously denied</strong>: The app&rsquo;s system settings open, where the user can manually enable push notifications.</li>
</ul>

**Web behavior:**

* **Permission already granted**: No prompt appears. The user continues without interruption because browsers do not allow re-prompting for permissions that are already granted.
* **Permission not yet decided**: The browser's permission prompt appears, allowing the user to grant, deny, or dismiss the request.
* **Permission previously denied**: No prompt appears. Users must manually enable notifications through their browser settings, as browsers do not allow sites to re-prompt after a denial.

The same behavior applies to Push Opt-In set for Scene media or screen.

### Share {#share-button}

<p><em>Share</em> prompts the user to share your message with apps, social media accounts, and other services. Enter the text you want to accompany the share, including any promotional information, shortened links, hashtags, etc.</p>

### Submit Responses

*Submit Responses* performs the [Validate Form](#validate-form) action and opens another screen or closes the Scene. A button or media (image only) using this action is required in any Scene containing content elements that request user input: Email, NPS, Question, SMS, and Text Input. When the action occurs, the user input is recorded for reporting.

For SDKs iOS 19.6+ and Android 19.9+, a button or media with this action is always active, even if required fields are not filled. For previous SDK versions, it is inactive until the user provides all required input.

A button or media using this action must be positioned after the last input element in the Scene or [branch](https://www.airship.com/docs/guides/messaging/in-app-experiences/configuration/branching/), and it can only be used once per Scene.

If you later delete all input elements from a Scene, the action automatically changes to [Next](#next) and the Confirmation screen, if any, is deleted.

Select a behavior:

| Behavior | Description |
| --- | --- |
| **Dismiss** | The Scene closes. |
| **Dismiss and cancel Repeat** | The Scene closes and [Repeat](https://www.airship.com/docs/guides/messaging/in-app-experiences/configuration/optional-features/#repeat-this-message) is canceled. |
| **Next screen** | The Scene advances to the next screen. |
| **Open confirmation screen** | A Confirmation screen opens, where you can tell the user that they successfully submitted their responses. If you select this option, a Confirmation screen is added to your Scene automatically for you to configure. |

### Validate Form

[iOS SDK 19.6+](/docs/docs/developer/sdk-integration/apple/ios-changelog/#19.6.0) [Android SDK 19.9+](/docs/docs/developer/sdk-integration/android/changelog/#19.9.0)

*Validate Form* checks the current screen for the presence of content in required fields in a Scene, validates the format of entered phone numbers and email addresses, and either opens another screen or closes the Scene. Use this action to validate the input on each screen in a multi-screen form, and provide a [Submit Responses](#submit-responses) button or image on the last screen.

* These content elements can be marked as required: [Email](https://www.airship.com/docs/guides/messaging/in-app-experiences/configuration/content/#email), [NPS](https://www.airship.com/docs/guides/messaging/in-app-experiences/configuration/content/#nps), [Question](https://www.airship.com/docs/guides/messaging/in-app-experiences/configuration/content/#question), [SMS](https://www.airship.com/docs/guides/messaging/in-app-experiences/configuration/content/#sms), and [Text Input](https://www.airship.com/docs/guides/messaging/in-app-experiences/configuration/content/#text-input).
* Email addresses are validated for [Email](https://www.airship.com/docs/guides/messaging/in-app-experiences/configuration/content/#email) fields. A valid email address is in standard format and must include a top-level domain extension such as .com, .edu, or .org. For example, `hot.sauce@airship.com`.
* Phone numbers are validated for [SMS](https://www.airship.com/docs/guides/messaging/in-app-experiences/configuration/content/#sms) fields. A valid phone number for collection is a [MSISDN](https://www.airship.com/docs/reference/glossary/#msisdn) for the country configured for the SMS input field. A valid phone number for channel registration is a MSISDN for the country code associated with the [Sender ID](https://www.airship.com/docs/reference/glossary/#sender_id) configured for the field.

An error state is indicated for invalid Email, SMS, Text Input, and open Question fields. When input is invalid, the field is highlighted with a red border, and an exclamation point icon appears within the field. No error state appears for NPS and single- and multiple-choice Question fields.

When the screen is valid, the selected behavior occurs.

Select a behavior:

| Behavior | Description |
| --- | --- |
| **Next screen** | The Scene advances to the next screen. |
| **Previous screen** | The Scene returns to the previous screen. |
| **Dismiss** | The Scene closes. |
| **Dismiss and cancel Repeat** | The Scene closes and [Repeat](https://www.airship.com/docs/guides/messaging/in-app-experiences/configuration/optional-features/#repeat-this-message) is canceled. |

### Web Page

<p><em>Web Page</em> opens a web page or any valid device-level URL such as App Store or app protocol links. The web page opens in the device&rsquo;s default browser. Enter a URL.</p>

## Options

You can configure additional events that occur when a user performs an action.

### Emit a Custom Event

Emit a [Custom Event](https://www.airship.com/docs/reference/glossary/#custom_event) when a user taps a button, image, or screen. You can select an existing event or name a new one.

<p>You can also assign an event value and specify string, number, or boolean property values that you can use later when filtering Custom Events. If you want to use properties, you must define the event and its properties in your project in advance. See <a href="https://www.airship.com/docs/guides/audience/events/manage/">Manage Events</a>.</p>
<ol>
<li>Select <strong>Configure options</strong>.</li>
<li>Under <strong>Options</strong>, select <strong>Emit custom event</strong> and search for an event. If no result is found, select <strong>Use &lt;event name&gt;</strong> to add the event to your project.</li>
<li>(Optional) Set an event value and/or specify property values to filter by in segments and triggers:
<ol>
<li>Select <strong>Add event properties</strong>, then:
<ul>
<li>For a value, select <strong>Add event value</strong> and enter a numeric value for the event.</li>
<li>For properties, select <strong>Add property</strong>, then <strong>Search for properties</strong>, and then search for a string, number, or boolean event property and enter or select a value.</li>
</ul>
</li>
<li>Select <strong>Save</strong>.</li>
</ol>
</li>
</ol>

### Set Tags {#set-tag}

Set and/or remove a [Tag](https://www.airship.com/docs/reference/glossary/#tag) on the channel ID when a user taps a button, text, image, or screen.

1. Select **Configure options**.
1. Under **Button options**, select **Add tag** or **Remove tag**, then search for tags that exist in the system, or create a new tag.

Select **Configure another option** for additional tags.

> **Tip:** Use [tag-based targeting](https://www.airship.com/docs/guides/audience/segmentation/target-specific-users/#target-tags) to prevent an in-app message from being seen or to chain the display of messages. E.g., set a tag "message1" on display of one message, and only display a second message to users who have the "message1" tag.


> **Note:** The ability to set tags based on user actions is key to promoting new features.
> The suggested approach is to display messages regarding a feature if the tag
> does not exist, and to then set the tag to record either the fact that the user
> has acknowledged the message, or to record actual usage of the feature. You can
> set a tag when a user clicks a button/text/media/screen, or even upon display, but recording actual feature usage requires some native code
> within the app. See our [SDK](https://www.airship.com/docs/sdk-topics/tags/) documentation for code samples and additional information.


### Subscription List opt in/out {#opt-in}

[AXP](https://www.airship.com/docs/reference/feature-packages/)

Opt a user in to or out of a [Subscription List](https://www.airship.com/docs/reference/glossary/#subscription_list) when the user taps a button, text, image, or screen.

1. Select **Configure options**.
1. Under **Button options**, select **Opt in to** or **Opt out of**, then search for a subscription list by name. When you first select the search field, you can select from your five most recently modified subscription lists.

Select **Configure another option** for additional subscription lists.
