Skip to content

Commit

Permalink
Add usage script
Browse files Browse the repository at this point in the history
  • Loading branch information
rajbos committed Dec 18, 2024
1 parent fd61aae commit 720d422
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import React from 'react';
import React, { useEffect } from 'react';

function Header() {
return (
<header>
<script defer data-domain="github-copilot.xebia.ms" src="https://plausible.io/js/script.js"></script>
</header>
);
useEffect(() => {
const script = document.createElement('script');
script.src = "https://plausible.io/js/plausible.js";
script.setAttribute('data-domain', 'github-copilot.xebia.ms');
document.head.appendChild(script);

return () => {
document.head.removeChild(script);
};
}, []);

return null;
}

export default Header;

0 comments on commit 720d422

Please sign in to comment.