Skip to main content

Analytics Module

The Analytics module provides comprehensive traffic monitoring and conversion tracking capabilities, helping you understand visitor behavior and optimize your platform’s performance.

Overview

Access detailed analytics at /analisis featuring:

Traffic Metrics

Page visits, bounce rate, and session duration

Conversion Tracking

Monitor conversion rates and goal completions

Traffic Sources

Visualize where your visitors come from

Page Performance

Analyze most visited pages and engagement

Route Configuration

The analytics page is defined in routes/web.php:
Route::get('/analisis', fn() => view('analisis'))->name('analisis');
View file: resources/views/analisis.blade.php

Page Layout

The analytics module extends the app layout:
@extends('layouts.app')

@section('title', 'Análisis - Dashboard')
@section('side_analisis', 'active')

@section('content')
    <!-- Analytics content -->
@endsection
Features export and filter functionality:
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
    <h1 class="h2">
        <i class="fas fa-chart-line text-primary"></i> Análisis
    </h1>
    <div class="btn-group me-2">
        <button class="btn btn-sm btn-outline-secondary">Exportar</button>
        <button class="btn btn-sm btn-outline-secondary">Filtrar</button>
    </div>
</div>
  • Export functionality for reports
  • Filter button for date ranges
  • Responsive button group
  • Icon-enhanced header

Analytics KPI Cards

Four comprehensive metrics track visitor behavior:
1

Total Visits Card

<div class="col-md-3">
    <div class="card text-white bg-primary mb-3">
        <div class="card-body">
            <h5 class="card-title">
                <i class="fas fa-eye"></i> Visitas
            </h5>
            <p class="card-text display-6">24,530</p>
            <small class="text-white-50">+8% esta semana</small>
        </div>
    </div>
</div>
Displays: 24,530 total visits with 8% weekly growth
2

Conversion Rate Card

<div class="col-md-3">
    <div class="card text-white bg-success mb-3">
        <div class="card-body">
            <h5 class="card-title">
                <i class="fas fa-mouse-pointer"></i> Conversiones
            </h5>
            <p class="card-text display-6">3.2%</p>
            <small class="text-white-50">+0.5% este mes</small>
        </div>
    </div>
</div>
Displays: 3.2% conversion rate with 0.5% monthly improvement
3

Average Session Time Card

<div class="col-md-3">
    <div class="card text-white bg-warning mb-3">
        <div class="card-body">
            <h5 class="card-title">
                <i class="fas fa-clock"></i> Tiempo Promedio
            </h5>
            <p class="card-text display-6">4:32</p>
            <small class="text-white-50">min por sesión</small>
        </div>
    </div>
</div>
Displays: 4 minutes 32 seconds average session duration
4

Bounce Rate Card

<div class="col-md-3">
    <div class="card text-white bg-info mb-3">
        <div class="card-body">
            <h5 class="card-title">
                <i class="fas fa-undo"></i> Rebote
            </h5>
            <p class="card-text display-6">42%</p>
            <small class="text-white-50">-3% vs anterior</small>
        </div>
    </div>
</div>
Displays: 42% bounce rate (3% improvement)

Metrics Explained

Visitas (Visits)
  • Total number of page views
  • Includes repeat visits from same users
  • Tracked per week/month/year
Conversiones (Conversions)
  • Percentage of visitors completing desired actions
  • Examples: purchases, sign-ups, downloads
  • Higher is better (industry average: 2-5%)
Tiempo Promedio (Average Time)
  • Mean session duration across all visitors
  • Format: minutes:seconds
  • Indicates content engagement level
Rebote (Bounce Rate)
  • Percentage of single-page sessions
  • Lower is better (good: <40%)
  • High bounce may indicate poor UX

Weekly Traffic Chart

Line chart displaying traffic patterns throughout the week:
<div class="row mb-4">
    <div class="col-md-8">
        <div class="card">
            <div class="card-header">
                <h5>Tráfico Semanal</h5>
            </div>
            <div class="card-body">
                <canvas id="traficoChart" height="180"></canvas>
            </div>
        </div>
    </div>
</div>

Chart Configuration

new Chart(document.getElementById('traficoChart').getContext('2d'), {
    type: 'line',
    data: {
        labels: ['Lun','Mar','Mié','Jue','Vie','Sáb','Dom'],
        datasets: [{
            label: 'Visitas',
            data: [1200, 1900, 1500, 2100, 2800, 3200, 1800],
            borderColor: 'rgb(54,162,235)',
            backgroundColor: 'rgba(54,162,235,0.1)',
            tension: 0.3,
            fill: true
        }]
    },
    options: {
        responsive: true
    }
});

Weekly Traffic Pattern

Weekday Traffic

Mon-Thu: 1,200 - 2,100 visitsSteady growth mid-week

Peak Days

Fri-Sat: 2,800 - 3,200 visitsHighest traffic period

Weekend Drop

Sunday: 1,800 visitsTraffic decrease
Saturday shows the highest traffic (3,200 visits) - consider scheduling important content releases on Fridays.

Traffic Sources Chart

Doughnut chart showing visitor acquisition channels:
<div class="col-md-4">
    <div class="card">
        <div class="card-header">
            <h5>Fuentes de Tráfico</h5>
        </div>
        <div class="card-body">
            <canvas id="fuentesChart" height="180"></canvas>
        </div>
    </div>
</div>

Chart Configuration

new Chart(document.getElementById('fuentesChart').getContext('2d'), {
    type: 'doughnut',
    data: {
        labels: ['Orgánico','Directo','Social','Referido'],
        datasets: [{
            data: [40, 30, 20, 10],
            backgroundColor: [
                'rgba(75,192,192,0.8)',
                'rgba(54,162,235,0.8)',
                'rgba(255,206,86,0.8)',
                'rgba(255,99,132,0.8)'
            ]
        }]
    },
    options: {
        responsive: true,
        plugins: {
            legend: {
                position: 'bottom'
            }
        }
    }
});

Traffic Source Breakdown

Search Engine Traffic
  • Google, Bing, Yahoo searches
  • Best quality traffic
  • High conversion potential
  • Color: Teal
Largest traffic source - indicates strong SEO performance

Most Visited Pages Table

Comprehensive page performance metrics:
<div class="row">
    <div class="col-md-12">
        <div class="card">
            <div class="card-header">
                <h5>Páginas Más Visitadas</h5>
            </div>
            <div class="card-body">
                <table class="table table-striped table-hover">
                    <thead>
                        <tr>
                            <th>Página</th>
                            <th>Visitas</th>
                            <th>Tiempo Promedio</th>
                            <th>Tasa de Rebote</th>
                            <th>Conversiones</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td><i class="fas fa-home text-primary"></i> /inicio</td>
                            <td>8,432</td>
                            <td>2:15</td>
                            <td>38%</td>
                            <td><span class="badge bg-success">4.2%</span></td>
                        </tr>
                        <tr>
                            <td><i class="fas fa-shopping-cart text-success"></i> /productos</td>
                            <td>6,210</td>
                            <td>5:40</td>
                            <td>22%</td>
                            <td><span class="badge bg-success">7.8%</span></td>
                        </tr>
                        <tr>
                            <td><i class="fas fa-info-circle text-warning"></i> /nosotros</td>
                            <td>3,105</td>
                            <td>3:20</td>
                            <td>55%</td>
                            <td><span class="badge bg-warning">1.2%</span></td>
                        </tr>
                        <tr>
                            <td><i class="fas fa-envelope text-info"></i> /contacto</td>
                            <td>2,890</td>
                            <td>4:10</td>
                            <td>30%</td>
                            <td><span class="badge bg-success">5.5%</span></td>
                        </tr>
                        <tr>
                            <td><i class="fas fa-blog text-danger"></i> /blog</td>
                            <td>1,980</td>
                            <td>6:45</td>
                            <td>65%</td>
                            <td><span class="badge bg-danger">0.8%</span></td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

Page Performance Analysis

1

Top Performer: /productos

Best Overall Performance
  • Visits: 6,210
  • Avg Time: 5:40 (highest engagement)
  • Bounce: 22% (excellent)
  • Conversion: 7.8% (best)
This page has the highest conversion rate - analyze what makes it successful.
2

High Traffic: /inicio

Most Visited Page
  • Visits: 8,432 (highest)
  • Avg Time: 2:15
  • Bounce: 38% (good)
  • Conversion: 4.2%
Home page performs well with reasonable engagement.
3

Needs Improvement: /blog

Optimization Opportunity
  • Visits: 1,980 (lowest)
  • Avg Time: 6:45 (high engagement)
  • Bounce: 65% (poor)
  • Conversion: 0.8% (lowest)
High bounce rate despite long session time indicates potential UX issues. Consider:
  • Improving internal linking
  • Adding clearer CTAs
  • Optimizing page load speed

Performance Metrics Table

PageVisitsTimeBounceConversionStatus
/inicio8,4322:1538%4.2%Good
/productos6,2105:4022%7.8%Excellent
/nosotros3,1053:2055%1.2%Fair
/contacto2,8904:1030%5.5%Good
/blog1,9806:4565%0.8%Needs Work

Complete Analytics Scripts

Both charts are initialized in the @section('scripts') block:
@section('scripts')
<script>
// Weekly Traffic Chart
new Chart(document.getElementById('traficoChart').getContext('2d'), {
    type: 'line',
    data: {
        labels: ['Lun','Mar','Mié','Jue','Vie','Sáb','Dom'],
        datasets: [{
            label: 'Visitas',
            data: [1200, 1900, 1500, 2100, 2800, 3200, 1800],
            borderColor: 'rgb(54,162,235)',
            backgroundColor: 'rgba(54,162,235,0.1)',
            tension: 0.3,
            fill: true
        }]
    },
    options: {
        responsive: true
    }
});

// Traffic Sources Chart
new Chart(document.getElementById('fuentesChart').getContext('2d'), {
    type: 'doughnut',
    data: {
        labels: ['Orgánico','Directo','Social','Referido'],
        datasets: [{
            data: [40, 30, 20, 10],
            backgroundColor: [
                'rgba(75,192,192,0.8)',
                'rgba(54,162,235,0.8)',
                'rgba(255,206,86,0.8)',
                'rgba(255,99,132,0.8)'
            ]
        }]
    },
    options: {
        responsive: true,
        plugins: {
            legend: {
                position: 'bottom'
            }
        }
    }
});
</script>
@endsection

Analytics Best Practices

Track Key Events

Set up conversion goals for:
  • Form submissions
  • Button clicks
  • Downloads
  • Purchases

Monitor Trends

Watch for:
  • Traffic spikes/drops
  • Bounce rate changes
  • Conversion fluctuations
  • Session time trends

Optimize Content

Improve pages with:
  • High bounce rates
  • Low conversions
  • Short session times
  • Poor engagement

Test & Iterate

Continuously:
  • A/B test changes
  • Analyze results
  • Implement improvements
  • Measure impact

Understanding Your Data

Good Indicators

  • Bounce Rate: < 40%
  • Conversion Rate: > 3%
  • Avg Session: > 3 minutes
  • Traffic Growth: Positive trend

Warning Signs

  • Bounce Rate: > 60%
  • Conversion Rate: < 1%
  • Avg Session: < 1 minute
  • Traffic Growth: Declining

Industry Benchmarks

  • E-commerce: 2-4% conversion
  • B2B: 3-5% conversion
  • SaaS: 5-10% conversion
  • Content: 40-60% bounce

Customization Tips

1

Update Traffic Data

Replace the data array with your actual metrics:
data: [1200, 1900, 1500, 2100, 2800, 3200, 1800]
2

Adjust Date Range

Change labels for different time periods:
labels: ['Week 1', 'Week 2', 'Week 3', 'Week 4']  // Monthly view
3

Add More Sources

Expand traffic sources tracking:
labels: ['Orgánico', 'Directo', 'Social', 'Referido', 'Email', 'Paid']
data: [40, 30, 15, 10, 3, 2]
Important: This module displays static demo data. For production use:
  • Integrate with Google Analytics API
  • Connect to your database analytics
  • Implement real-time tracking
  • Set up automated reporting

Next Steps

Dashboard Overview

Return to main dashboard documentation

Statistics Module

Explore detailed statistics and charts

Build docs developers (and LLMs) love