Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,22 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PyCon Colombia 2026</title>

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=%VITE_GA_ID%"></script>
<script>
var path = window.location.pathname;
if (!path.startsWith("/#") && !['/', ''].includes(path)) {
window.location.replace(`/#${path}`);
}
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(); }
gtag('js', new Date());

gtag('config', '%VITE_GA_ID%', {
send_page_view: false
});
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>

</body>
</html>
29 changes: 7 additions & 22 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,16 @@
import viteLogo from "/vite.svg";
import reactLogo from "./assets/react.svg";
import "./App.css";
import { Route, Routes } from "react-router-dom";
import { usePageTracking } from "./hooks/usePageTracking";
import Home from "./pages/Home";
import Team from "./pages/Team";

function App() {
usePageTracking();

return (
<>
<div>
<a href="https://vite.dev" target="_blank" rel="noopener">
<img src={viteLogo} className="logo" alt="Vite logo" />
</a>
<a href="https://react.dev" target="_blank" rel="noopener">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
</div>
<h1>Vite + React</h1>
<div className="card">
<p>
Edit <code>src/App.jsx</code> and save to test HMR
</p>
</div>
<p className="read-the-docs">
Click on the Vite and React logos to learn more
</p>
</>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/team" element={<Team />} />
</Routes>
);
}

Expand Down
1 change: 1 addition & 0 deletions src/hooks/usePageTracking.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export function usePageTracking() {
const location = useLocation();

useEffect(() => {
console.log("GA page view:", location.pathname);
if (!import.meta.env.VITE_GA_ID) return;

window.gtag?.("config", import.meta.env.VITE_GA_ID, {
Expand Down
5 changes: 5 additions & 0 deletions src/pages/Home/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Home = () => {
return <div>Home</div>;
};

export default Home;
5 changes: 5 additions & 0 deletions src/pages/Team/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Team = () => {
return <div>Team</div>;
};

export default Team;