learnr
User-events can be saved in a PostgreSQL database. To set-up the event store, call
setup_psql_event_store()
This function uses environment variables to determine the PostgreSQL connection information, but the values can also be set in the call.
Note: To avoid exposing the password, it is not advised to specify the password in the call directly!
Events are always associated with a user. The user id is either determined from a query string parameter, or set to a random UUID, once for a session. A session persists across reloads in the same browser for a set period of time, but not across browsers.
The user id is stored in a cookie in the browser. When the user visits the tutorial again, the user id is read from the cookie and events will be associated with the same user id as previous events.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.