Skip to content

Commit 36aa7fe

Browse files
authored
Merge pull request #1485 from onflow/brian-doyle/update-footer-links
Update footer and add tracking
2 parents d5a56ae + 537e00f commit 36aa7fe

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
@@ -316,164 +316,128 @@ const config = {
316316
style: 'dark',
317317
links: [
318318
{
319-
title: 'Documentation',
319+
title: 'Flow',
320320
items: [
321321
{
322-
label: 'Getting Started',
323-
to: '/blockchain-development-tutorials/cadence/getting-started/smart-contract-interaction',
322+
label: 'Build with AI',
323+
to: '/blockchain-development-tutorials/use-AI-to-build-on-flow',
324324
},
325325
{
326-
label: "Tools & SDKs",
327-
to: '/build/tools',
328-
},
329-
{
330-
to: 'https://cadence-lang.org/docs/',
331-
label: 'Cadence',
332-
},
333-
{
334-
to: '/blockchain-development-tutorials/cadence/mobile',
335-
label: 'Mobile',
336-
},
337-
{
338-
to: '/build/tools/clients/fcl-js/',
339-
label: 'FCL',
340-
},
341-
{
342-
to: '/build/cadence/smart-contracts/testing',
343-
label: 'Testing',
344-
},
345-
{
346-
to: '/build/tools/flow-cli/',
347-
label: 'CLI',
326+
label: 'Why Flow',
327+
to: '/blockchain-development-tutorials/flow-101',
348328
},
349329
{
350-
to: '/build/tools/emulator/',
351-
label: 'Emulator',
330+
label: 'Tools',
331+
to: '/build/tools',
352332
},
353333
{
354-
href: 'https://github.com/onflow/fcl-dev-wallet',
355-
label: 'Dev Wallet',
334+
label: 'Faucet',
335+
to: '/ecosystem/faucets',
356336
},
357337
{
358-
to: '/build/tools/vscode-extension/',
359-
label: 'VS Code Extension',
338+
label: 'Builder Toolkit',
339+
to: '/ecosystem/developer-support-hub',
360340
},
361341
],
362342
},
363343
{
364-
title: 'Community',
344+
title: 'Cadence',
365345
items: [
366346
{
367-
to: '/ecosystem',
368-
label: 'Ecosystem',
369-
},
370-
{
371-
href: 'https://port.flow.com/',
372-
label: 'Flow Port',
373-
},
374-
{
375-
href: 'https://github.com/onflow/developer-grants',
376-
label: 'Developer Grants',
347+
label: 'Quickstart',
348+
to: '/blockchain-development-tutorials/cadence/getting-started',
377349
},
378350
{
379-
href: 'https://flow.com/flow-responsible-disclosure',
380-
label: 'Responsible Disclosure',
351+
label: 'Build with Forte',
352+
to: '/blockchain-development-tutorials/forte',
381353
},
382354
{
383-
href: 'https://www.flowverse.co/',
384-
label: 'Flowverse',
355+
label: 'Cadence Advantages',
356+
to: '/blockchain-development-tutorials/cadence/cadence-advantages',
385357
},
386358
{
387-
href: 'https://academy.ecdao.org/',
388-
label: 'Emerald Academy',
359+
label: 'React SDK',
360+
to: '/build/tools/react-sdk',
389361
},
390362
{
391-
href: 'https://floats.city/',
392-
label: 'FLOATs (Attendance NFTs)',
393-
},
363+
label: 'Language Reference',
364+
href: 'https://cadence-lang.org/',
365+
}
394366
],
395367
},
396368
{
397-
title: 'Start Building',
369+
title: 'Solidity (EVM)',
398370
items: [
399371
{
400-
href: 'https://play.flow.com/',
401-
label: 'Flow Playground',
402-
},
403-
{
404-
to: 'https://cadence-lang.org/docs/tutorial/first-steps',
405-
label: 'Cadence Tutorials',
372+
label: 'Quickstart',
373+
to: '/build/evm/quickstart',
406374
},
407375
{
408-
href: 'https://cookbook.flow.com',
409-
label: 'Cadence Cookbook',
376+
label: 'Native VRF',
377+
to: '/blockchain-development-tutorials/native-vrf',
410378
},
411379
{
412-
to: '/build/cadence/core-contracts/',
413-
label: 'Core Contracts & Standards',
380+
label: 'Batched Transactions',
381+
to: '/blockchain-development-tutorials/cross-vm-apps',
414382
},
415383
{
416-
href: '/build/evm/quickstart',
417-
label: 'EVM',
418-
},
384+
label: 'Network Information',
385+
href: '/build/evm/networks',
386+
}
419387
],
420388
},
421389
{
422-
title: 'Network',
390+
title: 'Community & Support',
423391
items: [
424392
{
425-
href: 'https://status.flow.com/',
426-
label: 'Network Status',
393+
label: 'Dev Office Hours',
394+
href: 'https://calendar.google.com/calendar/u/0/embed?src=c_47978f5cd9da636cadc6b8473102b5092c1a865dd010558393ecb7f9fd0c9ad0@group.calendar.google.com',
427395
},
428396
{
429-
href: 'https://flowscan.io/',
430-
label: 'Flowscan Mainnet',
397+
label: 'Hackathons and Events',
398+
to: '/ecosystem/Hackathons%20and%20Events',
431399
},
432400
{
433-
href: 'https://testnet.flowscan.io/',
434-
label: 'Flowscan Testnet',
435-
},
436-
{
437-
to: '/protocol/node-ops/node-operation/past-upgrades',
438-
label: 'Past Sporks',
401+
href: 'https://discord.gg/flow',
402+
label: 'Discord',
439403
},
440404
{
441-
to: '/protocol/node-ops',
442-
label: 'Node Operation',
405+
href: 'https://github.com/onflow',
406+
label: 'GitHub',
443407
},
444408
{
445-
to: '/protocol/node-ops/node-operation/network-upgrade',
446-
label: 'Spork Information',
409+
href: 'https://flow.com/careers',
410+
label: 'Careers',
447411
},
448412
],
449413
},
450414
{
451-
title: 'More',
415+
title: 'Network & Resources',
452416
items: [
453417
{
454-
href: 'https://github.com/onflow',
455-
label: 'GitHub',
418+
href: 'https://status.flow.com/',
419+
label: 'Network Status',
456420
},
457421
{
458-
href: 'https://discord.gg/flow',
459-
label: 'Discord',
422+
href: 'https://flowscan.io/',
423+
label: 'Block Explorer',
460424
},
461425
{
462-
href: 'https://forum.flow.com/',
463-
label: 'Forum',
426+
href: 'https://port.flow.com/',
427+
label: 'Flow Port',
464428
},
465429
{
466430
href: 'https://flow.com/',
467-
label: 'Flow',
431+
label: 'Flow Website',
468432
},
469433
{
470434
href: 'https://flow.com/blog',
471-
label: 'Blog',
435+
label: 'Flow Blog',
472436
},
473437
],
474438
},
475439
],
476-
copyright: `Copyright © ${new Date().getFullYear()} Flow, Inc. Built with Docusaurus.`,
440+
copyright: `Copyright © ${new Date().getFullYear()} Flow Foundation. All Rights Reserved.`,
477441
},
478442
prism: {
479443
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)