Welcome to our Help Center 👋

How to configure your app for user specific notifications?

Learn how to configure your front-end app to receive user-specific notifications.
AS
Written by Anand S
Updated 7 months ago

Engagespot makes it easy for you to send user specific notifications. That is, if you want to send notification to a particular user on your app.

Engagespot needs a unique identifier for each of your users. This unique id is then used for sending notifications to that particular user. In most cases, unique id can be the auto increment id of your user in your database table.

To pass your user's unique id to Engagespot, you need to call the following javascript function

<script>
Engagespot.identifyUser('YOUR_USERS_ID');
</script>

The best place to call this function is right after login step. There is no problem in calling this function multiple times in your app.

Make sure to call this javascript function after the Engagespot SDK code. If the Engagespot SDK is not initialized, the function will throw undefined error.

When your user logs out of your application, you can call the following function to clear the identity mapping.

Engagespot.clearUser();

You can send a notification to this user using our REST API or PHP SDK to verify if the setup was successful.

Did this answer your question?