In this article, we are going to walk through the steps to trigger the "Opt-In Prompt" on a user action, like clicking a button.
We automatically show your “Opt-In Prompt” using a timer setting but we also allow you to have more direct control of when and how the “Opt-In Prompt” is triggered. You can use our code snippet to customize the experience for your website visitors.
Step By Step Instructions
- First, go to “Opt-In Prompt” settings and disable the “Opt-In Prompt” toggle. Since we are using a different trigger for the “Opt-In Prompt," we do not want it to automatically display using the timer.
- Then, add this class to an element on your page to manually trigger the prompt: aw_permit_prompt
Here are some examples of how you can add this to your website:
|Trigger on button click||<button onclick="aw_permit_prompt">Subscribe to notifications<button>|
|Trigger on link click||<a href=“#” class=“aw_permit_prompt”>Subscribe to notifications</a>|
|Trigger on image click||<img src="imagesrc.jpg" onclick=“aw_permit_prompt”>|