3Guide Docs

Set up analytics

Install tracking, identify your users, send the events that matter, and find your way around the analytics in the dashboard.

3Guide Analytics shows how people use your product: where they come from, what they do, where they drop off, and what goes wrong. It also flags problems for you on the Overview, so you don't have to go looking.

Before you start: you have a 3Guide account and your Site ID and Public Token from Settings → SDK Installation (Quickstart, steps 1–3).

Add the tracking script

Add it to every page, next to the 3Guide snippet if you use it (or on its own if analytics is all you want):

<script
  src="https://cdn.3guideai.com/sdk/guideai-tracking.js"
  data-guideai-bundle="tracking"
  data-site-id="YOUR_SITE_ID"
  data-token="pk_live_YOUR_TOKEN"
  async
></script>

The same domain rules apply as for the main snippet: the page's address must be listed under Settings → General (why).

In many countries (including under the GDPR and Nigeria's NDPA) you need consent before running analytics. The tracking script can be paused and resumed:

window.guideai.optOut() // stop tracking, e.g. until the visitor accepts
window.guideai.optIn()  // start tracking once they accept

The simplest approach is to only add the tracking script after the visitor accepts your cookie banner.

Identify signed-in users

After sign-in, and on every page load while signed in:

window.guideai.initialize({
  visitor: { id: currentUser.id, email: currentUser.email, full_name: currentUser.name },
  account: { id: currentAccount.id, name: currentAccount.name },
})

Use a stable internal ID, not the email. 3Guide merges the person's earlier anonymous activity into their profile. On sign-out, call window.guideai.clearSession() so the next person on the same browser starts fresh.

Send your key business events

Clicks and page views are collected automatically. What 3Guide can't know is when something meaningful succeeded. Send those events yourself, after the action is confirmed, not when the button is clicked:

window.guideai.track('onboarding_completed', { plan: currentAccount.plan, source: 'checklist' })

Keep event names short and consistent (project_created, not Created a new project!). They appear as-is in trends and funnels.

Optional: turn on session replays

Add data-recording="true" to the tracking script. Then, in Replays → Recording settings, choose the Sample rate, a Minimum duration, URL triggers or Event triggers to record only what matters, and Input masking to hide what people type. Replays record the page, so mention them in your privacy policy.

What's collected automatically

  • Sessions and pages: session start (with referrer, device and UTM tags), page views including single-page-app navigation, time on page, active and idle time, scroll depth
  • Interactions: clicks, rage clicks and dead clicks, form starts, submissions, errors and abandonment
  • Errors: JavaScript errors, failed network requests and UI errors

Find your way around the dashboard

SectionWhat it answers
OverviewHow things are going, and problems detected for you, such as confusing steps, forms people abandon or error spikes. "Nothing needs your attention" means none were found.
ProductGraphs & trends, Funnels, Retention, Lifecycle and Stickiness, broken down by page, device, browser, country and more
WebVisitors, page views, sources and conversion, like a web analytics tool
ReplaysSession recordings, filterable by date, errors and duration
ErrorsJavaScript and network errors and which sessions they hit
FlagsFeature flags for rolling changes out gradually
SurveysIn-product surveys and their results

Feature flags in your code

Create a flag in Flags, then check it in your app:

if (window.guideai.isFeatureEnabled('new-checkout')) {
  showNewCheckout()
}

Surveys from your code

Show a survey at a moment you choose, with an optional context label:

window.guideai.showNPSSurvey('billing')
window.guideai.showCSATSurvey('support')

Guide Pro demo analytics

Demo views, completions, CTA clicks and leads are tracked automatically for every published demo, with no script needed. Find them on the Guide Pro page (details).

All tracking options are in the SDK reference.

On this page