Skip to content

Track citation GTM events#298

Merged
ewlarson merged 1 commit into
developfrom
feature/issue-275-citation-ga-events
Jun 18, 2026
Merged

Track citation GTM events#298
ewlarson merged 1 commit into
developfrom
feature/issue-275-citation-ga-events

Conversation

@ewlarson

Copy link
Copy Markdown
Contributor

Summary

  • Add a GTM dataLayer helper for custom frontend events.
  • Fire cite_copy, cite_url, and cite_export events from the Cite & Reference panel with resource metadata.
  • Include the export format parameter for RIS, BibTeX, and JSON-LD export clicks.
  • Add coverage for no page-load event and each click payload.

Closes #275.

Validation

  • npm test -- --run src/__tests__/components/resource/CitationTable.test.tsx src/__tests__/services/analytics.test.ts
  • npx eslint src/components/resource/CitationTable.tsx src/services/analytics.ts src/__tests__/components/resource/CitationTable.test.tsx src/__tests__/services/analytics.test.ts src/pages/ResourceView.tsx src/components/resource/ResourceView.tsx
  • npx prettier --check src/components/resource/CitationTable.tsx src/services/analytics.ts src/__tests__/components/resource/CitationTable.test.tsx src/__tests__/services/analytics.test.ts src/pages/ResourceView.tsx src/components/resource/ResourceView.tsx
  • git diff --check

Note: full frontend lint/typecheck still report existing unrelated repo issues outside this PR scope.

@ewlarson ewlarson marked this pull request as ready for review June 18, 2026 20:44
@ewlarson ewlarson merged commit 0161c68 into develop Jun 18, 2026
15 of 17 checks passed
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.

Track Cite & Reference button clicks (Google Analytics & GTM)

1 participant