Manually trigger the opt-in prompt

Learn how to manually trigger the opt-in prompt.

While the opt-in prompt is easiest managed using our prompt management tool, you can also take more granular accesss of when to show it to your users by leveraging the _aimtellPrompt javascript function.

In order to do this, first head to your dashboard and edit the prompt management settings for your website and set the automatic prompt to false. This will make it so the notification prompt does not show automatically.

MT 1

At this point, you can trigger the prompt using a little javascript function: _aimtellPrompt().

Below are several examples.

Show prompt on page load

function _aimtellReady(){ _aimtellPrompt(); }


Copy and paste the above code just before the closing </body> tag on your website.

Show prompt on button click

<button onclick="_aimtellPrompt()"> Click To Subscribe <button>


Show prompt when a link is clicked

<a href="#" onclick="_aimtellPrompt()"> Click to subscribe </a>


Show prompt when an image is clicked

<img src="imagesrc.jpg" onclick="_aimtellPrompt()">



For more information on how to use our javascript api check out