mirror of
https://github.com/davila7/claude-code-templates.git
synced 2026-09-19 01:30:23 +08:00
4c76fe3aba
- Add track.html endpoint for visible tracking - Add api/track.html for silent tracking with 1x1 pixel - Create GitHub Action to process tracking logs - Use GitHub Pages infrastructure for anonymous tracking - No external dependencies or authentication required
66 lines
2.6 KiB
HTML
66 lines
2.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Tracking Endpoint</title>
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
padding: 20px;
|
|
font-family: monospace;
|
|
background: #000;
|
|
color: #0f0;
|
|
}
|
|
.terminal {
|
|
max-width: 600px;
|
|
margin: 0 auto;
|
|
}
|
|
.ok { color: #0f0; }
|
|
.info { color: #ff0; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="terminal">
|
|
<h1 class="ok">📊 Tracking Endpoint</h1>
|
|
<div id="status" class="info">Processing...</div>
|
|
<div id="details"></div>
|
|
|
|
<script>
|
|
// Parse URL parameters
|
|
const params = new URLSearchParams(window.location.search);
|
|
const trackingData = {
|
|
type: params.get('type'),
|
|
name: params.get('name'),
|
|
platform: params.get('platform'),
|
|
cli: params.get('cli'),
|
|
session: params.get('session'),
|
|
timestamp: new Date().toISOString(),
|
|
referrer: document.referrer || 'direct',
|
|
userAgent: navigator.userAgent
|
|
};
|
|
|
|
// Validate required params
|
|
if (!trackingData.type || !trackingData.name) {
|
|
document.getElementById('status').innerHTML = '<span style="color: #f00;">❌ Missing required parameters: type, name</span>';
|
|
document.getElementById('details').innerHTML = '<pre>Usage: track.html?type=agent&name=component-name&platform=darwin&cli=1.14.7&session=12345678</pre>';
|
|
} else {
|
|
// Show success
|
|
document.getElementById('status').innerHTML = '<span class="ok">✅ Download tracked successfully</span>';
|
|
document.getElementById('details').innerHTML =
|
|
'<h3>Tracked Event:</h3>' +
|
|
'<pre>' + JSON.stringify(trackingData, null, 2) + '</pre>' +
|
|
'<p class="info">This data will be processed by GitHub Actions to update download statistics.</p>';
|
|
|
|
// Try to send data to GitHub issue (if we implement it later)
|
|
// For now, just rely on GitHub Pages access logs
|
|
|
|
console.log('📊 Claude Code Templates - Download Tracked:', trackingData);
|
|
}
|
|
|
|
// Auto-close after 3 seconds (optional)
|
|
// setTimeout(() => window.close(), 3000);
|
|
</script>
|
|
</div>
|
|
</body>
|
|
</html> |