Skip to content

Commit 537e00f

Browse files
committed
Update footer and add tracking
1 parent 1a9ada0 commit 537e00f

File tree

3 files changed

+92
-90
lines changed

3 files changed

+92
-90
lines changed

docusaurus.config.js

Lines changed: 54 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -314,164 +314,128 @@ const config = {
314314
style: 'dark',
315315
links: [
316316
{
317-
title: 'Documentation',
317+
title: 'Flow',
318318
items: [
319319
{
320-
label: 'Getting Started',
321-
to: '/blockchain-development-tutorials/cadence/getting-started/smart-contract-interaction',
320+
label: 'Build with AI',
321+
to: '/blockchain-development-tutorials/use-AI-to-build-on-flow',
322322
},
323323
{
324-
label: "Tools & SDKs",
325-
to: '/build/tools',
326-
},
327-
{
328-
to: 'https://cadence-lang.org/docs/',
329-
label: 'Cadence',
330-
},
331-
{
332-
to: '/blockchain-development-tutorials/cadence/mobile',
333-
label: 'Mobile',
334-
},
335-
{
336-
to: '/build/tools/clients/fcl-js/',
337-
label: 'FCL',
338-
},
339-
{
340-
to: '/build/cadence/smart-contracts/testing',
341-
label: 'Testing',
342-
},
343-
{
344-
to: '/build/tools/flow-cli/',
345-
label: 'CLI',
324+
label: 'Why Flow',
325+
to: '/blockchain-development-tutorials/flow-101',
346326
},
347327
{
348-
to: '/build/tools/emulator/',
349-
label: 'Emulator',
328+
label: 'Tools',
329+
to: '/build/tools',
350330
},
351331
{
352-
href: 'https://github.com/onflow/fcl-dev-wallet',
353-
label: 'Dev Wallet',
332+
label: 'Faucet',
333+
to: '/ecosystem/faucets',
354334
},
355335
{
356-
to: '/build/tools/vscode-extension/',
357-
label: 'VS Code Extension',
336+
label: 'Builder Toolkit',
337+
to: '/ecosystem/developer-support-hub',
358338
},
359339
],
360340
},
361341
{
362-
title: 'Community',
342+
title: 'Cadence',
363343
items: [
364344
{
365-
to: '/ecosystem',
366-
label: 'Ecosystem',
367-
},
368-
{
369-
href: 'https://port.flow.com/',
370-
label: 'Flow Port',
371-
},
372-
{
373-
href: 'https://github.com/onflow/developer-grants',
374-
label: 'Developer Grants',
345+
label: 'Quickstart',
346+
to: '/blockchain-development-tutorials/cadence/getting-started',
375347
},
376348
{
377-
href: 'https://flow.com/flow-responsible-disclosure',
378-
label: 'Responsible Disclosure',
349+
label: 'Build with Forte',
350+
to: '/blockchain-development-tutorials/forte',
379351
},
380352
{
381-
href: 'https://www.flowverse.co/',
382-
label: 'Flowverse',
353+
label: 'Cadence Advantages',
354+
to: '/blockchain-development-tutorials/cadence/cadence-advantages',
383355
},
384356
{
385-
href: 'https://academy.ecdao.org/',
386-
label: 'Emerald Academy',
357+
label: 'React SDK',
358+
to: '/build/tools/react-sdk',
387359
},
388360
{
389-
href: 'https://floats.city/',
390-
label: 'FLOATs (Attendance NFTs)',
391-
},
361+
label: 'Language Reference',
362+
href: 'https://cadence-lang.org/',
363+
}
392364
],
393365
},
394366
{
395-
title: 'Start Building',
367+
title: 'Solidity (EVM)',
396368
items: [
397369
{
398-
href: 'https://play.flow.com/',
399-
label: 'Flow Playground',
400-
},
401-
{
402-
to: 'https://cadence-lang.org/docs/tutorial/first-steps',
403-
label: 'Cadence Tutorials',
370+
label: 'Quickstart',
371+
to: '/build/evm/quickstart',
404372
},
405373
{
406-
href: 'https://cookbook.flow.com',
407-
label: 'Cadence Cookbook',
374+
label: 'Native VRF',
375+
to: '/blockchain-development-tutorials/native-vrf',
408376
},
409377
{
410-
to: '/build/cadence/core-contracts/',
411-
label: 'Core Contracts & Standards',
378+
label: 'Batched Transactions',
379+
to: '/blockchain-development-tutorials/cross-vm-apps',
412380
},
413381
{
414-
href: '/build/evm/quickstart',
415-
label: 'EVM',
416-
},
382+
label: 'Network Information',
383+
href: '/build/evm/networks',
384+
}
417385
],
418386
},
419387
{
420-
title: 'Network',
388+
title: 'Community & Support',
421389
items: [
422390
{
423-
href: 'https://status.flow.com/',
424-
label: 'Network Status',
391+
label: 'Dev Office Hours',
392+
href: 'https://calendar.google.com/calendar/u/0/embed?src=c_47978f5cd9da636cadc6b8473102b5092c1a865dd010558393ecb7f9fd0c9ad0@group.calendar.google.com',
425393
},
426394
{
427-
href: 'https://flowscan.io/',
428-
label: 'Flowscan Mainnet',
395+
label: 'Hackathons and Events',
396+
to: '/ecosystem/Hackathons%20and%20Events',
429397
},
430398
{
431-
href: 'https://testnet.flowscan.io/',
432-
label: 'Flowscan Testnet',
433-
},
434-
{
435-
to: '/protocol/node-ops/node-operation/past-upgrades',
436-
label: 'Past Sporks',
399+
href: 'https://discord.gg/flow',
400+
label: 'Discord',
437401
},
438402
{
439-
to: '/protocol/node-ops',
440-
label: 'Node Operation',
403+
href: 'https://github.com/onflow',
404+
label: 'GitHub',
441405
},
442406
{
443-
to: '/protocol/node-ops/node-operation/network-upgrade',
444-
label: 'Spork Information',
407+
href: 'https://flow.com/careers',
408+
label: 'Careers',
445409
},
446410
],
447411
},
448412
{
449-
title: 'More',
413+
title: 'Network & Resources',
450414
items: [
451415
{
452-
href: 'https://github.com/onflow',
453-
label: 'GitHub',
416+
href: 'https://status.flow.com/',
417+
label: 'Network Status',
454418
},
455419
{
456-
href: 'https://discord.gg/flow',
457-
label: 'Discord',
420+
href: 'https://flowscan.io/',
421+
label: 'Block Explorer',
458422
},
459423
{
460-
href: 'https://forum.flow.com/',
461-
label: 'Forum',
424+
href: 'https://port.flow.com/',
425+
label: 'Flow Port',
462426
},
463427
{
464428
href: 'https://flow.com/',
465-
label: 'Flow',
429+
label: 'Flow Website',
466430
},
467431
{
468432
href: 'https://flow.com/blog',
469-
label: 'Blog',
433+
label: 'Flow Blog',
470434
},
471435
],
472436
},
473437
],
474-
copyright: `Copyright © ${new Date().getFullYear()} Flow, Inc. Built with Docusaurus.`,
438+
copyright: `Copyright © ${new Date().getFullYear()} Flow Foundation. All Rights Reserved.`,
475439
},
476440
prism: {
477441
theme: lightCodeTheme,

src/constants/ga-events.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const GA_EVENTS = {
66
SEARCH_CLICK: 'search_click',
77
FEEDBACK_CLICK: 'feedback_click',
88
AUTH_LOGIN: 'login',
9+
FOOTER_CLICK: 'footer_click',
910
} as const;
1011

1112
// Event categories for consistent tracking - Using existing categories
@@ -15,6 +16,7 @@ export const GA_CATEGORIES = {
1516
SEARCH: 'search',
1617
FEEDBACK: 'feedback',
1718
AUTH: 'auth',
19+
FOOTER: 'footer',
1820
} as const;
1921

2022
// Event actions for consistent tracking - Using existing actions
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React from 'react';
2+
import LinkItem from '@theme-original/Footer/LinkItem';
3+
import type {WrapperProps} from '@docusaurus/types';
4+
import { event } from '@site/src/utils/gtags.client';
5+
import { GA_EVENTS, GA_CATEGORIES } from '@site/src/constants/ga-events';
6+
7+
type Props = WrapperProps<typeof LinkItem>;
8+
9+
export default function LinkItemWrapper(props: Props): JSX.Element {
10+
const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {
11+
// Extract meaningful label from props
12+
const label = props.label || props.href || 'unknown-footer-item';
13+
14+
// Check if we're on the homepage
15+
const isHomepage = typeof window !== 'undefined' && window.location.pathname === '/';
16+
17+
// Track the footer link click with appropriate event based on page
18+
event({
19+
action: isHomepage ? GA_EVENTS.ACTION_CARD_CLICK : GA_EVENTS.FOOTER_CLICK,
20+
category: GA_CATEGORIES.FOOTER,
21+
label: label,
22+
location: true,
23+
});
24+
25+
// Call original onClick if it exists
26+
if (props.onClick) {
27+
props.onClick(e);
28+
}
29+
};
30+
31+
return (
32+
<>
33+
<LinkItem {...props} onClick={handleClick} />
34+
</>
35+
);
36+
}

0 commit comments

Comments
 (0)