Startup Starter Kits
  • Launch Manual
    • Clone the Repository and Install Dependencies
    • Generate NextJS Apps or Components Using ssk-plugin
    • Start Your Project in Development Mode
    • Configure Your Environment Variables
    • Run Your Project in Production Mode Locally
    • Launch Your Project
  • SSK-Core Features
    • UI Components
    • Root Layout
    • SEO
    • Icons
    • Feature Flags
    • Utilities
    • Templates
      • Privacy Policy Template
      • Terms of Service Template
  • SSK-Pro Features
    • AI Chat Integration
      • Setting Up AI Providers
      • Using the Pre-built Chat Component
      • Securing Chatbot Conversations
      • Testing and Customizing AI Responses
    • Google Analytics
      • Setting Up Google Analytics
      • Implementing Pageview Tracking
      • Handling Cookie Consent
      • Tracking Events
    • Payments Integration
      • Stripe Payments
        • Setting Up Your Stripe Account
        • Installing Stripe in Your Application
        • Implementing in Your Project
      • Lemon Squeezy
        • Setting Up Lemon Squeezy Account
        • Configuring the Webhook Endpoint
        • Testing and Verifying Integration
    • Affiliate Marketing
      • Lemon Squeezy
      • Rewardful
    • Form and reCAPTCHA
      • Setting Up reCAPTCHA
      • Integrating reCAPTCHA with Forms
      • Verifying reCAPTCHA on the Backend
      • Environment Variables for reCAPTCHA
      • Testing reCAPTCHA Integration
    • Email Integration with Nodemailer
      • Setting Up Email Server
      • Sending Contact Requests
    • Authentication
      • Auth with Google
      • Implement Auth0
  • SSK-Core GitHub Repo
  • SSK-Pro GitHub Repo
  • Contact Support
  • Three Tech Consulting
  • SSK-License
Powered by GitBook
On this page
  1. SSK-Pro Features
  2. Google Analytics

Implementing Pageview Tracking

Chapter 2:

Step 3 - Add Google Analytics to Your Application

For users of the SSK Pro version, the Google Analytics integration is already included in the RootLayout component, which automatically injects the GoogleAnalytics component into your app. This means that tracking page views is handled globally without any additional setup required from your end.

Here’s how the RootLayout in SSK Pro includes Google Analytics:

import { GoogleAnalytics } from '@pro/analytics/GoogleAnalytics'

function RootLayout() {
  return (
    <>
      <GoogleAnalytics />
      {/* Other SSK-Pro features */}
    </>
  )
}

What this means:

  • No manual integration needed: Since the GoogleAnalytics component is already integrated in the RootLayout, it automatically tracks page views and user behavior site-wide.

  • Page view tracking is automatic: Every page you add to the Pro version of your app will already be tracked by Google Analytics. Just ensure that the GA_MEASUREMENT_ID environment variable is correctly set.

  • Cookie consent handling: The Google Analytics setup respects the user’s cookie consent, so data is only sent if users have agreed to it.

In summary: For Pro users, the Google Analytics tracking functionality is baked into the foundation of your application via the RootLayout. You simply need to ensure that your Google Analytics Measurement ID is correctly added to your .env file.

PreviousSetting Up Google AnalyticsNextHandling Cookie Consent

Last updated 8 months ago