Skip to content

Add GA4 header_link_click event to GitHub nav link - #4692

Open
tiagov8 with Copilot wants to merge 4 commits into
mainfrom
copilot/components-layout-cloudbanner
Open

tiagov8 with Copilot wants to merge 4 commits into
mainfrom
copilot/components-layout-cloudbanner

Conversation

Copilot AI commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Fires a GA4 event when the GitHub star button in the site header is clicked, enabling tracking of header CTA engagement.

Changes

  • custom.d.ts — Augments Window with an optional gtag type so the call compiles without errors
  • components/AppNavBar.tsx — Adds onClick to both the desktop and mobile GitHubStarButton <Link> instances:
window.gtag?.('event', 'header_link_click', {
  link_name: 'GitHub',
  link_url: `https://github.com/${item.owner}/${item.repo}`,
  location: 'header',
});

Mobile handler preserves the existing closeMenu() call. Link target="_blank" behavior is unchanged.


General Contributing:

@vercel

vercel Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tina-io Ready Ready Preview Jul 29, 2026 9:19pm

Request Review

Copilot AI requested a review from tiagov8 July 9, 2026 00:54
@tiagov8
tiagov8 marked this pull request as ready for review July 10, 2026 20:09
@tiagov8
tiagov8 requested a review from a team as a code owner July 10, 2026 20:09
@tiagov8
tiagov8 requested a review from calumjs July 10, 2026 20:09
@tiagov8
tiagov8 enabled auto-merge (squash) July 10, 2026 20:09

This branch was successfully deployed

1 active deployment
Preview — d7b59cdf Deployed Jul 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants