Recipes
Clickstream Analytics Dashboard with StarTree Cloud Free Tier and Streamlit
This guide will walk you through creating a real-time clickstream analytics dashboard using StarTree Cloud Free Tier (Apache Pinot) and Streamlit.
Use Case
An e-commerce company wants to understand user behavior on their website to improve engagement, streamline the customer journey, and increase conversions. They need real-time insights into how users interact with their website’s content and design.
Solution
Use the following technologies:
- Apache Pinot: A real-time OLAP datastore to capture and analyze clickstream data.
- StarTree Cloud Free Tier: A managed service for Apache Pinot, providing a free tier for experimentation and development.
- Streamlit: A Python framework for building interactive web applications, perfect for creating our dashboard.
Dashboard Features
The dashboard will provide the following insights:
- Event Counts by Type: A bar chart showing how often different user actions occur (e.g., page views, product clicks, add to carts, purchases).
- Average Duration by Event Type: A table displaying the average time users spend on each type of event.
Benefits
- Content Optimization: Identify underperforming pages and improve them based on user engagement.
- Conversion Funnel Enhancement: Analyze the user journey and find areas where users drop off.
- Personalization: Tailor website content and recommendations in real-time.
- A/B Testing: Measure the impact of website changes by comparing clickstream data.
- Marketing Campaign Effectiveness: Track the success of marketing campaigns.
Prerequisites
StarTree Cloud Free Tier Account: Sign up for a free account at StarTree.ai
- Python and Streamlit: Install Python and Streamlit on your local machine.
- Sample Data: Prepare sample clickstream data or use the provided sample data.
Steps
Generate an Authentication Token:
- Log in to your StarTree Cloud account.
- Navigate to the “API Tokens” section.
- Generate a new token with appropriate permissions.
Update Broker URL and Token:
- Replace placeholders in the Python script with your actual StarTree Cloud broker URL and authentication token.
Install Required Packages:
- Run pip install streamlit pandas altair requests in your terminal.
Run the Streamlit App:
- Save the provided Python script as streamlit_app.py.
- Execute streamlit run streamlit_app.py.
Access the Dashboard:
- Open your web browser and go to http://localhost:8501.
Code
[streamlit_app.py] For the StarTree Free Tier - Serverless use the following script
Note: Before running the script make sure to update the Pinot Broker URL and Bearer Token
[streamlit_app.py] For Dedicate Pinot Instance use this script
Note: Before running the script make sure to replace the Pinot Broker URL and Basic Auth Token