Skip to content

Commit

Permalink
Update matomo configuration (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zishan-7 authored Oct 17, 2024
1 parent 7587fab commit 19e58f7
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,18 @@
s.parentNode.insertBefore(g, s);
})();
</script>
<script type="text/javascript">
var _mtm = (window._mtm = window._mtm || []);
_mtm.push({ 'mtm.startTime': new Date().getTime(), event: 'mtm.Start' });
(function () {
var d = document,
g = d.createElement('script'),
s = d.getElementsByTagName('script')[0];
g.async = true;
g.src =
'https://cdn.matomo.cloud/nethermind.matomo.cloud/container_zPmiPdiA.js';
s.parentNode.insertBefore(g, s);
})();
</script>
</body>
</html>
4 changes: 2 additions & 2 deletions src/onboarding/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ export default function Login() {
window._paq.push([
'trackEvent',
'Login',
'User logged in successfully',
data.email
'User logged in successfully'
]);
navigate('/');
} else {
Expand Down Expand Up @@ -157,6 +156,7 @@ export default function Login() {

<Button
className="rounded-sm border border-secondary text-secondary hover:border-focus hover:text-focus"
data-matomo-id="login-btn"
fullWidth
isLoading={state.isLoading}
type="submit"
Expand Down
8 changes: 2 additions & 6 deletions src/onboarding/Register.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,7 @@ export default function Register() {
});
if (completeSignUp.status === 'complete') {
await setActive({ session: completeSignUp.createdSessionId });
window._paq.push([
'trackEvent',
'Sign Up',
'New account created',
getValues('email')
]);
window._paq.push(['trackEvent', 'Sign Up', 'New account created']);
navigate('/');
} else {
console.error(JSON.stringify(completeSignUp, null, 2));
Expand Down Expand Up @@ -274,6 +269,7 @@ export default function Register() {

<Button
className="rounded-sm border border-secondary text-secondary hover:border-focus hover:text-focus"
data-matomo-id="create-acc-btn"
fullWidth
isLoading={state.isLoading}
type="submit"
Expand Down
8 changes: 8 additions & 0 deletions src/shared/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default function Footer() {
<li className="flex h-6 items-center" key={`footer-main-${i}`}>
<Link
className="text-xs text-foreground-2"
data-matomo-id={item.id}
href={item.href}
onPress={() =>
item.matomoEventData &&
Expand All @@ -40,6 +41,7 @@ export default function Footer() {
<li className="flex h-6 items-center" key={`footer-social-${i}`}>
<Link
className={`${item.className} text-xs text-foreground-2`}
data-matomo-id={item.id}
href={item.href}
onPress={() =>
item.matomoEventData &&
Expand Down Expand Up @@ -69,6 +71,7 @@ export default function Footer() {

const mainLinks = [
{
id: 'audit-smart-contract',
title: 'Audit smart contract',
href: 'https://www.nethermind.io/smart-contract-audits',
matomoEventData: [
Expand All @@ -78,6 +81,7 @@ const mainLinks = [
]
},
{
id: 'nethermind-operator',
title: 'Nethermind operator',
href: 'https://app.eigenlayer.xyz/operator/0x110af279aaffb0d182697d7fc87653838aa5945e',
matomoEventData: [
Expand All @@ -87,10 +91,12 @@ const mainLinks = [
]
},
{
id: 'legal',
title: 'Legal',
href: '/terms-and-conditions'
},
{
id: 'api-docs',
title: 'API Docs',
href: `${import.meta.env.VITE_API_BASE_URL}/swagger`,
matomoEventData: [
Expand All @@ -103,12 +109,14 @@ const mainLinks = [

const socialLinks = [
{
id: 'social-x',
title: 'Follow us',
className: 'footer-x',
href: 'https://x.com/NethermindEth',
matomoEventData: ['Social Media', 'X', 'https://x.com/NethermindEth']
},
{
id: 'social-discord',
title: 'Join us',
className: 'footer-discord',
href: 'https://discord.com/invite/PaCMRFdvWT',
Expand Down
2 changes: 2 additions & 0 deletions src/shared/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default function Sidebar({ onOpenChange }) {

<Button
className="rounded-md border border-foreground-2"
data-matomo-id="support-us-btn"
onPress={() => {
window._paq.push([
'trackEvent',
Expand All @@ -105,6 +106,7 @@ export default function Sidebar({ onOpenChange }) {
<Button
className="hover:!text-content1"
color="primary"
data-matomo-id="signin-nav-btn"
fullWidth
onClick={() => {
window._paq.push([
Expand Down

0 comments on commit 19e58f7

Please sign in to comment.