Skip to content

Quick start

This guide takes you from an empty page to a guide running for an identified user. You need a UserGuiding account and access to your web app’s HTML.

Add the container script

In the panel, open Settings > Containers and copy the installation snippet for your container. Paste it into the <head> of every page where UserGuiding should run.

<script>
(function(g,u,i,d,e,s){g[e]=g[e]||[];var f=u.getElementsByTagName(i)[0];var k=u.createElement(i);k.async=true;k.src='https://static.userguiding.com/media/user-guiding-'+s+'-embedded.js';f.parentNode.insertBefore(k,f);if(g[d])return;var ug=g[d]={q:[]};ug.c=function(n){return function(){ug.q.push([n,arguments])};};var m=['previewGuide','finishPreview','track','identify','page','hideChecklist','launchChecklist'];for(var j=0;j<m.length;j+=1){ug[m[j]]=ug.c(m[j]);}})(window,document,'script','userGuiding','userGuidingLayer','YOUR_CONTAINER_ID');
</script>

Replace YOUR_CONTAINER_ID with your container ID. EU accounts load the script from https://eu-static.userguiding.com instead.

Identify the signed in user

Call identify once you know who the user is, usually right after sign in. Pass your own user ID and any attributes you want to target content with.

window.userGuiding.identify('user_123', {
name: 'Jamie Rivera',
plan: 'growth',
created_at: 1717315200000,
company: {
id: 'acme',
name: 'Acme Inc.',
},
})

The user and their attributes appear under Users in the panel within a few seconds.

Track an event

Page views are captured automatically. Track the actions that matter to your product with track:

window.userGuiding.track('report_exported', { format: 'csv' })

You can use events to trigger content, build segments and measure goals.

Launch content from code

Build a guide in the panel and publish it. Then start it from code with its ID:

window.userGuiding.previewGuide(1234)

Every material has a launch method. See Checklists, Resource Center, Surveys and the other method pages.

Check the installation

Open your app, then run this in the browser console:

window.userGuiding.activateTroubleshooter()

The troubleshooter shows whether the container loaded, who the current user is and why each piece of content did or did not show.