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.
At this point, you can trigger the prompt using a little javascript function: _aimtellPrompt().
Below are several examples.
Show prompt on page load
<script>
function _aimtellReady(){ _aimtellPrompt(); }
</script>
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 https://aimtell.com/api