Learn R Programming

bidux (version 0.4.0)

bid_suggest_analytics: Suggest alternative analytics solutions for static dashboards

Description

Provides recommendations for analytics and telemetry solutions suitable for static Quarto dashboards, where Shiny-based telemetry (shiny.telemetry or OpenTelemetry) is not available. This function helps you choose the right analytics tool based on your needs and constraints.

Important: shiny.telemetry and Shiny OpenTelemetry only work with server: shiny in Quarto YAML. For static Quarto dashboards (including OJS-based dashboards), you need alternative web analytics solutions.

Usage

bid_suggest_analytics(
  dashboard_type = c("static", "ojs", "python"),
  privacy_preference = c("gdpr_compliant", "privacy_focused", "standard"),
  budget = c("flexible", "free", "low"),
  self_hosted = FALSE
)

Value

A data frame with recommended analytics solutions, including:

solution

Name of the analytics platform

type

Type of solution (privacy-focused, traditional, open-source)

cost

Cost tier (free, paid, freemium)

self_hosted

Whether self-hosting is available

gdpr_compliant

Whether the solution is GDPR compliant

integration_method

How to integrate (script tag, API, etc.)

key_features

Main features for UX analysis

bidux_compatibility

How well it works with BID framework

docs_url

Link to integration documentation

Arguments

dashboard_type

Character string specifying the type of dashboard:

static

Static HTML Quarto dashboard (default)

ojs

Quarto dashboard using Observable JS

python

Static dashboard with Python/Jupyter

privacy_preference

Character string indicating privacy requirements:

gdpr_compliant

Prioritize GDPR-compliant solutions (default)

privacy_focused

Emphasize user privacy and no tracking

standard

Standard analytics with typical tracking

budget

Character string indicating budget constraints:

free

Only free/open-source solutions

low

Low-cost solutions (< $10/month)

flexible

Any cost tier (default)

self_hosted

Logical indicating whether self-hosted solutions are preferred (default: FALSE)

Integration Patterns

For Static Quarto Dashboards:

  1. Event Tracking - Track user interactions with custom events:

    • Button clicks, filter changes, tab switches

    • Use JavaScript event listeners in Quarto

    • Send events to analytics platform via API

  2. Session Analysis - Monitor user sessions:

    • Page views, time on page, bounce rate

    • User flow through dashboard sections

    • Identify drop-off points

  3. Custom Dimensions - Track dashboard-specific metrics:

    • Selected filters, date ranges, visualization types

    • User cohorts, roles, or departments

    • Dashboard version or configuration

Example Integration (Plausible Analytics):

Add to your Quarto dashboard header:

<script defer data-domain="yourdomain.com"
  src="https://plausible.io/js/script.tagged-events.js"></script>

Track custom events in your dashboard JavaScript:

// Track filter change
document.getElementById('regionFilter').addEventListener('change', function(e) {
  plausible('Filter Changed', {props: {filter: 'region', value: e.target.value}});
});

// Track visualization interaction plotElement.on('plotly_click', function(data) { plausible('Chart Interaction', {props: {chart: 'sales_plot', action: 'click'}}); });

Analyzing Results with BID Framework:

While these analytics tools won't automatically integrate with bid_ingest_telemetry(), you can still apply BID framework principles:

  1. Notice - Export analytics data, identify friction points manually

  2. Interpret - Use bid_interpret() with insights from analytics

  3. Anticipate - Apply bid_anticipate() to plan improvements

  4. Structure - Design improvements with bid_structure()

  5. Validate - Measure impact with before/after analytics comparison

Examples

Run this code
# Get recommendations for static Quarto dashboard with GDPR compliance
suggestions <- bid_suggest_analytics(
  dashboard_type = "static",
  privacy_preference = "gdpr_compliant"
)
print(suggestions)

# Find free, privacy-focused solutions for OJS dashboard
privacy_options <- bid_suggest_analytics(
  dashboard_type = "ojs",
  privacy_preference = "privacy_focused",
  budget = "free"
)

# Get self-hosted options
self_hosted <- bid_suggest_analytics(
  dashboard_type = "static",
  self_hosted = TRUE
)

# View top recommendation
top_choice <- suggestions[1, ]
cat(sprintf("Recommended: %s\n", top_choice$solution))
cat(sprintf("Integration: %s\n", top_choice$integration_method))
cat(sprintf("Docs: %s\n", top_choice$docs_url))

Run the code above in your browser using DataLab