website-assistant/Behavior Data Analytics

7.4 Behavior Data Analytics

Pop provides a powerful behavior data collection and analytics system that helps you understand your website visitors’ origins, behavior paths, device distribution, and usage patterns.
This analytics system shares the same JavaScript embed script as Pop’s AI assistant SDK, so there is no need for additional integration.

Website analytics mainly include:

  • Visitor and session tracking
  • Page views (PV/UV)
  • Access paths and dwell time
  • Device, browser, and OS distribution
  • Geolocation
  • Real-time visitor monitoring
  • Custom events (future expansion)

1. How Pop’s Analytics System Works

Once the Pop JS SDK is embedded, the script automatically performs the following:

Item Description
Device detection Automatically detects browser, OS, resolution, screen size
Session management Generates session ID (sid) using Cookie / LocalStorage
Visitor identification Generates visitor ID (cid) using fingerprint + Cookie
Page event tracking PV, dwell time, exit events, scroll behavior
Geolocation IP-based country/province/city lookup (handled in Pop backend)
Performance data (optional) TTFB, FCP, LCP, etc. (future expansion)

You do not need to write any tracking code—simply load the Pop SDK.


2. Analytics Dashboard Overview

After embedding the SDK, you will see the following data panels in the Pop backend:

2.1 Sessions & Visitors

This page shows:

  • Total website visits
  • Unique visitors (UV)
  • Total page views (PV)
  • Average dwell time
  • New vs returning visitors

The table includes:

  • Visitor device information (mobile / PC, brand, OS version)
  • Browser type
  • Geolocation
  • First visit time
  • Last visit time

2.2 Real-time Visitors

This section shows:

  • Users currently visiting your website
  • Pages they are viewing
  • Real-time request count
  • Device type in use
  • Whether the visitor opened the assistant window

Real-time monitoring is very useful for handling sudden traffic spikes, attacks, or customer activity.


2.3 Page View Trends

The line chart displays:

  • Today’s traffic
  • 7-day / 30-day traffic trends
  • Top pages by views
  • Traffic by referrer (source)

This helps you understand which content is most engaging to users.


2.4 Geo Analytics

Displays:

  • Country distribution
  • Province/city distribution
  • Heatmap (if supported later)

This helps identify your audience’s geographic distribution.


2.5 Device / Browser / OS Analytics

Automatically recognizes:

  • Mobile / PC / tablet distribution
  • Operating systems (Windows, macOS, iOS, Android, etc.)
  • Browsers (Chrome, Safari, Edge, Firefox…)
  • Screen size distribution

Pop includes built-in normalization, for example:
“iPhone 14 Pro / Safari” → “Apple iPhone / Safari”.


3. How Behavior Data Is Collected

Pop SDK automatically listens for the following events:

Event Type Description
PV (page view) Triggered when the user enters a page
Dwell time Sent when user leaves (beforeunload)
Scroll behavior Tracks whether the user read the content
Page navigation (SPA) Automatically detects route changes
Error events Captures JS errors (if enabled)
Assistant actions Whether user opened chat window, sent messages

These events are instantly sent to your Pop server, and you can view the analytics at any time.


4. How to Verify Analytics Works

Enable debug mode in your browser:

https://your-site.com?pop_debug=1

You will see in the developer console:

  • siteKey
  • SDK load status
  • Visitor ID (cid)
  • Session ID (sid)
  • Reported events
  • HTTP request responses

Verification steps:

  1. Open the page & console
  2. Refresh → you should see analytics/pageview
  3. Change pages → reports pageview(route-change)
  4. Leave page → reports staytime

If events are being reported, analytics is working properly.


5. Frequently Asked Questions (FAQ)

Q1: I embedded the SDK but see no data?

Possible reasons:

  • Incorrect siteKey (must match server config)
  • Script blocked (check browser console)
  • Domain not added to allowed origins
  • Mixed HTTP/HTTPS causing browser blocking

Q2: Why doesn’t SPA routing trigger analytics?

Ensure:

window.pop?.trackPageview();

Is called when your front-end router triggers route changes.
(If using Pop’s default script, SPA detection is automatic.)


Q3: How to differentiate multiple sites?

Use a different siteKey for each website.


6. Summary

Behavior data analytics is a core capability of Pop’s website assistant system. It helps you:

  • Understand visitor behavior
  • Analyze traffic sources
  • Identify core audiences
  • Evaluate content performance
  • Improve conversion and retention using AI assistant integration