Table of Contents

When your users interact with the Olvy widgets, whether it is giving you feedback using your feedback widget or reacting "Awesome!" to a release note, you would want to know who the particular feedback or reaction is coming from.

User Identification allows you to add a user's information with the actions they take using Olvy widgets. You can also pass the user's preferred language, so the Announcement widget opens in that language automatically.

In order to identify a user, call the following function in your application:

OlvyUtils.setUser("<your-subdomain>", {
    name: "name of your user",
    email: "email of your user",
    identifier: "unique id for your user (primary key)",
    language: "(optional) language code, for example da",
    designation: "(optional) designation of your user",
    meta: { plan: "(optional) any additional info as a JSON object" }
})

Replace <your-subdomain> with the subdomain of your Olvy workspace. For example, if your Olvy releases page is at acme.olvy.co, replace <your-subdomain> with acme.

That's all. Olvy's script will now associate your user information with all actions they take.

Where to call setUser

We recommend calling setUser inside onReady, so it runs once the Olvy script has loaded:

<script>
  var OlvyConfig = {
    workspaceAlias: "<your-subdomain>",
    onReady: function () {
      OlvyUtils.setUser("<your-subdomain>", {
        name: "name of your user",
        email: "email of your user",
        identifier: "unique id for your user (primary key)",
        language: "da"
      });
    }
  };
</script>
<script type="text/javascript" src="https://app.olvy.co/scriptV3.js" defer="defer"></script>

Every setup is different, so if your app loads user details later (for example, after login), you can call setUser at that point instead, as long as the Olvy script has already loaded.

Linking Tags and Companies

You can also pass the tags and companies you want to link a user to in the identification process itself.

OlvyUtils.setUser("<your-subdomain>", {
    name: "name of your user",
    email: "email of your user",
    identifier: "unique id for your user (primary key)",
    language: "(optional) language code, for example da",
    designation: "(optional) designation of your user",
    meta: { plan: "(optional) any additional info as a JSON object" },
    tags: ["tag1", "tag2"],
    companies: [
        {
            name: "name of the company",
            website: "domain name of the company"
        }
    ]
})

The tags key is an array of strings. Add the name of the tag you want to link to the user. If the tag you passed doesn't exist, Olvy will automatically create the tag and add it to the user.

The companies key is an array of objects, where each object is a company and takes three keys: name, website, and meta. Name and website are required keys for user identification.

Companies and Tags are only added via the user identification process, and not removed. If you want to remove the associations, you'll need to do it from the Olvy app or via the API.

Opening the Announcement widget in your user's language

If your app already knows your user's preferred language, pass it as language in setUser. The Announcement widget then opens in that language right away, so your users don't have to switch manually. They can still change it with the language switcher.

Before you start

  • Go to Changelog Settings → Multi-language settings and enable the languages you want.
  • In Widgets → Announcements, set the widget's Language and turn on the Language Switcher.

Supported language codes

  • English: en
  • Danish: da
  • Swedish: sv
  • Norwegian: no
  • German: de
  • Spanish: es
  • French: fr
  • Portuguese: pt

Codes are not case sensitive, and region formats like fr-FR also work.

Which language will my user see?

  1. The language you pass, if it's enabled in your workspace.
  2. Otherwise, the default Language set within changelog settings

If the value you pass isn't supported or isn't enabled, it's ignored silently and widget will load in default language.

When the user changes language in your app

Call setUser again with the new language, and the widget switches straight away:

OlvyUtils.setUser("<your-subdomain>", {
    name: "name of your user",
    email: "email of your user",
    identifier: "unique id for your user (primary key)",
    language: "sv"
})

Good to know

  • New release notes can take a moment to appear in other languages, because translations are created in the background.
  • For logged-out visitors, skip setUser. They'll see the widget's Language setting, or the language they pick in the switcher.