If you don't want Upscope to load for all users because you have too many or for privacy concerns, you can use the following code to trigger Upscope only when needed.

1. Use this code

In your installation code, add the following option to the init  function:

<script>
// Rest of installation code
Upscope('init', {
  autoconnect: false
});
</script>

This will prevent Upscope from connecting automatically to our server, unless they have connected before.

2. Create a function to display a lookup code

<script>
  function showSupportCode() {
    Upscope('connect');
 
    Upscope('getLookupCode', function(code) {
      alert("Please tell our agent code " + code);
    });
  }
</script>

Calling this function will connect Upscope to the server and show the visitor a unique 4 digit lookup code.

3. Add a "Help" button

Use the following code to add a help button wherever you like on your website:

<a href="javascript:showSupportCode()">I need help!</a>

You can customize this however you like.

When the user clicks the button, he will be shown a 4 digit code to read your agent.

... or use javascript to load Upscope instead

Alternatively, you can just call Upscope('connect');  (or showSupportCode() ) directly in your code. When you do this, Upscope will always connect in future page loads, and will connect automatically on other open tabs.

4. Look for the code in the user list

Head over to https://app.upscope.io/ and enter the four digit code your user has given you and they will pop up on your screen.

Did this answer your question?