Installation Guides
Replit Installation
Install Jetrack on your Replit-hosted website
Replit is an online IDE with built-in hosting and AI assistance. Use these prompts with Replit AI to add Jetrack!
AI Prompt (Recommended)
If your Repl has AI chat, use this prompt:
Add Jetrack to my website. Open index.html and add this script to the <head> section:
<script
async
defer
data-website-id="your-unique-id"
src="https://analytics.brandjet.ai/script.js">
</script>
Make sure it's added before the closing </head> tag.Replace your-unique-id with your BrandJet website ID.
Framework-Specific Prompts
For static HTML/CSS/JS:
Add analytics tracking to index.html. Add this script tag in the <head> section:
<script
async
defer
data-website-id="your-unique-id"
src="https://analytics.brandjet.ai/script.js">
</script>For Node.js/Express:
Add Jetrack to my Express app. Add the script to my main template file (views/index.ejs or views/index.html) in the <head> section.With Replit Secrets:
Add Jetrack using Replit Secrets:
1. I'll add BRANDJET_WEBSITE_ID to Secrets
2. Update the template to use process.env.BRANDJET_WEBSITE_ID
3. Add the script tag using that environment variableFor React/Next.js on Replit:
Add Jetrack to my React app's index.html file in the <head> section.Manual Installation
For HTML/CSS/JS Template
- Open
index.htmlin the file explorer - Add the script to the
<head>:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Replit Site</title>
<!-- Jetrack -->
<script
async
defer
data-website-id="your-unique-id"
src="https://analytics.brandjet.ai/script.js">
</script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Hello World</h1>
<script src="script.js"></script>
</body>
</html>- Click Run and you're done!
For Node.js/Express
Add to your template file (e.g., views/index.ejs):
<head>
<title><%= title %></title>
<!-- Jetrack -->
<script
async
defer
data-website-id="your-unique-id"
src="https://analytics.brandjet.ai/script.js">
</script>
</head>Using Replit Secrets
For better security:
Step 1: Add Secret
- Click the lock icon 🔒 (Secrets) in the left sidebar
- Add new secret:
- Key:
BRANDJET_WEBSITE_ID - Value:
your-unique-id
- Key:
Step 2: Use in Code
For server-rendered templates:
// server.js
app.get('/', (req, res) => {
res.render('index', {
brandjetId: process.env.BRANDJET_WEBSITE_ID
})
})<!-- views/index.ejs -->
<script
async
defer
data-website-id="<%= brandjetId %>"
src="https://analytics.brandjet.ai/script.js">
</script>Testing
- Click the green Run button
- Your site opens in the Replit webview
- Click "Open in new tab" for accurate testing
- Press F12 → Network tab
- Look for
script.jsfromanalytics.brandjet.ai - Check your BrandJet dashboard
Pro Tips
Verify installation:
Show me the index.html file and confirm the Jetrack script is in the <head> section.If not working:
The analytics script isn't loading. Check:
1. Is it in index.html?
2. Is the syntax correct?
3. Are there any errors in the console?For all pages:
Make sure the Jetrack script loads on every page of my site, not just the homepage.Troubleshooting
Script Not Loading
Try this AI prompt:
Debug the Jetrack installation:
1. Open index.html
2. Find the <head> section
3. Verify the script tag is there and correctly formatted
4. Show me any console errorsWorks in Webview But Not in New Tab
This is normal - always test in a new tab/window for accurate tracking.
Custom Domain Not Tracking
I set up a custom domain. Make sure the analytics script works on both the .repl.co URL and my custom domain.Replit Deployments
Works on:
- Replit webview (
your-repl.username.repl.co) - Deployed sites
- Custom domains
The script is included automatically in all environments!
Framework Guides
For React/Next.js/Vue projects: