Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
View your CI Pipeline Execution ↗ for commit 1d56bf3
☁️ Nx Cloud last updated this comment at |
65f71f2 to
994e6e1
Compare
## Current Behavior Only markdown and text file requests are tracked server-side via the track-asset-requests edge function. HTML page views are not tracked on the server, missing requests from AI tools and curl. ## Expected Behavior Track all doc page views server-side with a new edge function that: - Sends `server_page_view` events to GA4 with `content_type` param - Uses Netlify's `excludedPath` config for efficient path filtering - Skips non-HTML requests via Accept header check Changes: - Add track-page-requests.ts edge function for HTML pages - Update track-asset-requests.ts to use `server_page_view` event name - Add `content_type` param to differentiate HTML/markdown/text in GA4 - Refactor add-link-headers.ts to use excludedPath config ## Related Issue(s) Fixes DOC-395 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
barbados-clemens
approved these changes
Feb 2, 2026
bcabanes
approved these changes
Feb 2, 2026
jaysoo
added a commit
that referenced
this pull request
Feb 2, 2026
## Current Behavior
Only markdown and text file requests are tracked server-side via the
`track-asset-requests` edge function. HTML page views are not tracked on
the server, missing requests from AI tools and curl.
## Expected Behavior
Track all doc page views server-side with a new edge function that:
- Sends `server_page_view` events to GA4 with `content_type` param to
differentiate HTML/markdown/text
- Uses Netlify's `excludedPath` config for efficient path filtering
(zero compute for excluded paths)
- Skips non-HTML requests via Accept header check
### Changes
| File | Change |
|------|--------|
| `track-page-requests.ts` | **NEW** - Edge function for HTML page view
tracking on `/docs/*` |
| `track-asset-requests.ts` | Changed event name to `server_page_view`,
added `content_type` param |
| `add-link-headers.ts` | Refactored to use `excludedPath` config
instead of runtime path checks |
| `netlify.toml` | Added edge function declaration for
`track-page-requests` |
### GA Event Schema
```javascript
{
name: 'server_page_view',
params: {
content_type: 'text/html' | 'text/markdown' | 'text/plain',
file_extension: '.html' | '.md' | '.txt',
is_ai_tool: 'true' | 'false',
// ... other params
}
}
```
## Other Notes
This PR also removes the edge function entries from `netlify.toml` since
it's auto detected from `astro-docs/netlify/edge-functions`. This makes
all the configuration in the actual `.ts` file, not duplicated in the
`netlify.toml` file.
## Related Issue(s)
Closes DOC-395
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
FrozenPandaz
pushed a commit
that referenced
this pull request
Feb 3, 2026
## Current Behavior
Only markdown and text file requests are tracked server-side via the
`track-asset-requests` edge function. HTML page views are not tracked on
the server, missing requests from AI tools and curl.
## Expected Behavior
Track all doc page views server-side with a new edge function that:
- Sends `server_page_view` events to GA4 with `content_type` param to
differentiate HTML/markdown/text
- Uses Netlify's `excludedPath` config for efficient path filtering
(zero compute for excluded paths)
- Skips non-HTML requests via Accept header check
### Changes
| File | Change |
|------|--------|
| `track-page-requests.ts` | **NEW** - Edge function for HTML page view
tracking on `/docs/*` |
| `track-asset-requests.ts` | Changed event name to `server_page_view`,
added `content_type` param |
| `add-link-headers.ts` | Refactored to use `excludedPath` config
instead of runtime path checks |
| `netlify.toml` | Added edge function declaration for
`track-page-requests` |
### GA Event Schema
```javascript
{
name: 'server_page_view',
params: {
content_type: 'text/html' | 'text/markdown' | 'text/plain',
file_extension: '.html' | '.md' | '.txt',
is_ai_tool: 'true' | 'false',
// ... other params
}
}
```
## Other Notes
This PR also removes the edge function entries from `netlify.toml` since
it's auto detected from `astro-docs/netlify/edge-functions`. This makes
all the configuration in the actual `.ts` file, not duplicated in the
`netlify.toml` file.
## Related Issue(s)
Closes DOC-395
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
(cherry picked from commit cdd735d)
Contributor
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current Behavior
Only markdown and text file requests are tracked server-side via the
track-asset-requestsedge function. HTML page views are not tracked on the server, missing requests from AI tools and curl.Expected Behavior
Track all doc page views server-side with a new edge function that:
server_page_viewevents to GA4 withcontent_typeparam to differentiate HTML/markdown/textexcludedPathconfig for efficient path filtering (zero compute for excluded paths)Changes
track-page-requests.ts/docs/*track-asset-requests.tsserver_page_view, addedcontent_typeparamadd-link-headers.tsexcludedPathconfig instead of runtime path checksnetlify.tomltrack-page-requestsGA Event Schema
Other Notes
This PR also removes the edge function entries from
netlify.tomlsince it's auto detected fromastro-docs/netlify/edge-functions. This makes all the configuration in the actual.tsfile, not duplicated in thenetlify.tomlfile.Related Issue(s)
Closes DOC-395
🤖 Generated with Claude Code