Add Visitors' Emails

The Email Integration feature is available only for customers who collect their visitors’ email addresses somewhere on their site. Here are the most common use cases:
  • The site can be entered in a logged-in state
    In this case, the site has sign-up and login forms. A user can be logged into the site (as well as logged out), and the site will usually look a bit different depending on a visitor’s login status. For example, a page might be headed with ″Hello, <user-name>″, or a logged-in visitor might have access to different parts of the site than a visitor who is not logged in. Oribi’s website is a good example of a site that has a logged-in state.

    In this scenario, we recommend our customers call the Oribi API with the current visitor’s email address on each page load where the visitor is logged in and the email is part of the code’s context. This can be done on any page load where the email address is available in some variable in the code, in order to also capture visitors who are already logged in to the system or who have refreshed their cookies, etc.
  • The site has a one-time subscription form
    In this case, the site features some kind of form that visitors will (usually) each fill out once, like a subscription to a newsletter or a contact form.

    In this scenario, we recommend adding the email integration to the place in the code where you have a variable that keeps the visitor’s email (which they have entered into your site’s form and submitted), and then call the Oribi API method, passing that variable to it.

    Code Example

     // Tracks the email of a website visitor Oribi
      ORIBI.api('setUserEmail', <replace variable name here>)
    It is important to note that if this sort of integration is applied, the call to the Oribi API will happen after a successful form submission (click on submit) in order to avoid sending Oribi an incorrect email address, which could result from an error in the form (such as a bad email format, missing characters, etc).

Integrating the Code

Once Oribi’s script is installed on your site, ask your developer to add the call ORIBI.api('setUserEmail', email) in all relevant pages. Please note that this function will only take a single argument: the email your visitors provide on your site. Please also ensure that any JavaScript code added to your website is wrapped in <script> and </script> tags.

Code Example

 // Tracks the email of a website visitor Oribi
  ORIBI.api('setUserEmail', <replace variable name here>)
The ORIBI.api('setUserEmail', 'email address') method can be called each time a page loads for a visitor you can identify by email, and as many times as needed (i.e. post-login or post-signup page). Oribi will connect the visitor's email to their unique Oribi identifier.
Please note that implementing the email integration incorrectly could merge your users’ data, and that combining email address and user ID is not reversible. We advise you to test the implementation and revert the code change if necessary.

Impersonating Visitors

When you’re impersonating visitors (e.g., by logging in as a specific visitor through your app’s admin system), we recommend to differentiate impersonated and "real" visitors, either by not setting the impersonated visitor’s email or by changing the email passed to ORIBI.api('setUserEmail', email).


For sites with a logged-in state, we do not currently support identifying multiple users on a single device/browser. That is, if a visitor logged in to your site, logged out, and then a different visitor logged in on the same browser, the activities of the second visitor would be mapped onto the first email