User Vista Help
  • 👋User Vista Help Center
  • Overview
    • 💡What we do
    • ✨Our Features
  • Product Guides
    • 🚀Launch First Survey
    • 📽️Setup Video
  • Use Cases
    • 🖥️For Developers
Powered by GitBook
On this page
  1. Use Cases

For Developers

PreviousSetup Video

Last updated 1 year ago

Go to the settings page to get your script -

Setting up UserVista Instrusctions

Installation Script

CONNECT

Copy and paste this into the header on your website

<script>var flexblocID = "CT-UNIQUETOYOU"</script> 
<script src="https://app.uservista.ai/assets/UNIQUETOYOU.js" 
type="text/javascript"></script>

SET USER INFORMATION

Call this js function from within your code any time your website is loaded to set the user email and or phone number.

var setUserInfoUserVista = function (email, phone, userGroups)

Angular Example

    
      declare function setUserInfoUserVista(email:string,phone:string,userGroups:Array<string>):any;
      @Component({...
      ngOnInit(): void {
       declare function setUserInfoUserVista(email:string,phone:string,userGroups:Array<string>):any;
      }
  

In the above function you will be setting the user's email, phone number, and user groups. Email and phone number will be retrievable when you view individual responses.

If you choose to set User Groups it will be useful when you create a survey and specify the user groups it should be shown to.

This will ensure that you have control over which user groups see specific surveys.

Test Setting User Info

To test if this will work, you can first call our test function. This will show an alert with the sent value to show if the values will be set correctly in our system.

var testSetUserInfoUserVista = function (email, phone)

Angular Example

declare function testSetUserInfoUserVista(email:string,phone:string):any; @Component({... ngOnInit(): void {
testSetUserInfoUserVista(this.userEmail, this.userPhoneNumber); }

🖥️
https://app.uservista.ai/home/setup