Tracking site visitors using REST APIs

If you integrate using REST APIs, you are responsible for tracking site visitors on your own. This means that you are responsible for assigning a cookie ID to each site visitor if they don't already have one stored in their browser. Then, you must pass the ID to Discover at runtime.

Unless you are working with a mobile native app, we recommend that you obtain the uuid using rfk.uid(). This saves you from having to assign IDs yourself.

If you do not have access to the beacon, you must assign each user an anonymous user_id that is stored either as a cookie or in local storage so that it can identify the same user across multiple sessions.

This user_id must not be personally identifiable information (PII) like email or membership ID. It must be different from the permanent user identifier, which is an internal ID or email that is only available upon login.

Note

If present, the permanent user ID can also be sent as part of the user object upon login.

To associate a user with their actions across your site, you must send the user_id and/or uuid as part of the event object in calls to the Events API. It must also be sent in calls to the Search and Recommendation API.

Do you have some feedback for us?

If you have suggestions for improving this article,