Testing Website Analytics System project Locally

Phase 0.5: Testing Your Web Analytics Project Locally Using Python

Welcome to Phase 0.5

Welcome to Phase 0.5 of building our custom web analytics system for sankalandtech.com! After organizing our project folders and setting up Git, the next crucial step is to make sure our local website files are working correctly. This involves running a simple local web server and checking that your selected pages (like your homepage and C tutorial pages) load properly in your browser.

This phase is all about verifying your local development environment. It's like turning on the lights and making sure everything looks right before you start building the complex machinery of your analytics system.


Why We Need to Test Locally

Before we start writing backend analytics code or creating dashboards, we need to confirm that the local copy of our site is functioning as expected. Here's why this matters:

Early Error Detection: Running the site locally helps catch broken links, missing assets, or HTML errors before they become bigger issues.
Local Workflow: Testing locally ensures your edits are reflected immediately, making development much faster and safer.
Foundation Check: A working website structure is essential, since all our analytics scripts will be integrated into these pages.
Environment Confidence: Confirming everything loads correctly gives us confidence that our local development environment mirrors the live site.


Screenshot of a local website running using Python HTTP server with command prompt open

Important Note: Keep the Server Running!

For your local website to remain accessible in your browser, the Python HTTP server needs to keep running in your Command Prompt window. Do not close that CMD window until you are finished testing or developing your website locally. If you close it, your local website will no longer be available.


Steps to Test Your Website Locally

We'll use Python’s built-in simple HTTP server to quickly launch your local website for testing. Follow the steps below to make sure everything is set up correctly.

Step 1: Open your Command Prompt (CMD). If your previous window is closed or already in use, make sure to start a new one so you're working in a clean environment.

Step 2: Navigate to your website/ folder. This is the folder that contains your index.html file (if included) and the Tutorials/C/ subfolder. You need to be inside this folder to serve its contents properly. Use the following command to navigate: cd E:\SankalanAnalytics\website\. Be sure to adjust the path if your SankalanAnalytics project is saved in a different location.

Step 3: Start the Python Simple HTTP Server. Once you're inside the website/ folder, run this command: python -m http.server 8000. This will start a local web server using port 8000. After running the command, you should see output like this in the Command Prompt: Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) .... Leave this window open, as closing it will stop the server and your website will no longer be accessible locally.

Step 4: Open your web browser. You can use any modern browser like Chrome, Firefox, or Microsoft Edge.

Step 5: In the browser’s address bar, type http://localhost:8000/ and press Enter. Your browser should now display the contents of your website/ folder. If you have an index.html file, it will load automatically. If not, you’ll see a directory listing, and you can click on the Tutorials/C/ folder to access your C tutorial pages.

Step 6: Verify that your pages are working as expected. Browse through your site and check that the text appears correctly, styles from your CSS files are being applied, images are loading properly, and any basic JavaScript is functioning. If everything looks good, your local development environment is ready for use.

When you're done testing, go back to the Command Prompt window and stop the server by pressing Ctrl+C. That’s it — your local setup is complete and you’re ready to move forward!


Previous Topic==> Directory|Folder Structure! ||  Next Topics==> Analytics Project Overview!


SQL All topics Wise Interview Questions    Employee Salary Management SQL FAQ!.   C FAQ   Top 25 PL/SQL Interview Questions

Joins With Group by Having  Equi Join  Joins with Subqueries  Self Join  Outer Join 


Website Analytics Project: Phases and Action Steps

  • Home
  • 🟢 Live App: Web Analytics Simulator
  • Phase 0: Project Setup & Problem Definition
  • 0.1 Define Project Goals & Challenges
  • 0.2 Select Tools, Tech Stack & Data Sources
  • 0.3 Software Requirements & Installation
  • 0.4 Folder Structure & GitHub Repo
  • 0.5 Testing Project Locally
  • Phase 1: Planning for Analytics
  • 1.1 Website Analytics Project Overview
  • 1.2 Define KPIs, Bounce Rate, Engagement
  • 1.3 Identify Target Users & Pain Points
  • Phase 2: Data Collection
  • 2.1 Setup Google Analytics 4 (GA4)
  • 2.2 Export GA4 Data to BigQuery/CSV
  • 2.3 Design SQL Schema for Web Analytics
  • Phase 3: Data Cleaning & Feature Engineering
  • 3.1 Clean Website Data with Python & Pandas
  • 3.2 Create Custom Metrics (Session, Bounce, etc.)
  • Phase 4: Exploratory Data Analysis (EDA)
  • 4.1 Analyze Website Traffic Trends
  • 4.2 Behavior by Device, Source, Location
  • 4.3 Top Pages & High Bounce Pages
  • 4.4 Diagnose Low Traffic & User Drop
  • Phase 5: Business Insights
  • 5.1 Funnel Analysis & Drop-Off Points
  • 5.2 New vs Returning Users
  • 5.3 Time Spent & Scroll Depth
  • Phase 6: SQL for Business
  • 6.1 SQL for Business Insights
  • 6.2 Combine Web Data Using SQL
  • 6.3 Find Problematic Pages Using SQL
  • Phase 7: Machine Learning
  • 7.1 Segment Users with Clustering
  • 7.2 Predict Bounce Rate with ML
  • 7.3 Recommend Pages or Content
  • Phase 8: Dashboards & Visualization
  • 8.1 Dashboard with Streamlit
  • 8.2 Visualize KPIs with Python
  • 8.3 Page-Level Metrics & Drop Heatmaps
  • Phase 9: Final Analytics Story
  • 9.1 Summary Report & Findings
  • Phase 10: Hosting & Portfolio Presentation
  • 10.1 Host Website Project Online
  • 10.2 Add to GitHub with ReadMe
  • 10.3 Pitch Project in Interview
  • Other Topics
  • SQL Interview Questions
  • SQL Case Study: Account Management
  • Python Interview Questions
  • Why C Language

Get in touch

  • tech2dsm@gmail.com

© Sankalan Data Tech. All rights reserved.