Redirect /progress to the homepage with campaign parameters - #65
Merged
Conversation
/progress is the vanity URL printed on an out-of-home ad. It has never been a route here, so it 404s today. It redirects to the homepage carrying utm_source/medium/campaign, rather than to a bare "/", because GA4 reads those off the landing URL and files the visit under the campaign in its acquisition reports. A plain redirect would be invisible: the server-side hop fires no analytics event of its own, so the scan would arrive as an ordinary homepage pageview, indistinguishable from organic traffic — which defeats the point of giving the ad its own URL. The values live in one constant so the campaign can be renamed in a single place. Temporary (307) on purpose: a 308 would sit in a visitor's browser and skip the server on later visits, leaving repeat scans uncounted. The trailing-slash variant is covered too, because skipTrailingSlashRedirect is on for the PostHog proxy and "/progress/" won't normalize itself. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Greptile SummaryAdds temporary redirects from both
Confidence Score: 5/5The PR appears safe to merge, with both intended vanity URL forms redirected to the campaign-tagged homepage. The fixed same-origin destination preserves the UTM query parameters, and the two exact redirect rules cover the path variants required by the existing trailing-slash configuration.
|
| Filename | Overview |
|---|---|
| next.config.ts | Adds narrowly scoped temporary redirects for /progress and /progress/; no actionable correctness issue was identified. |
Reviews (1): Last reviewed commit: "Redirect /progress to the homepage with ..." | Re-trigger Greptile
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
/progressis the vanity URL printed on an out-of-home ad. It has never been a route here, so it 404s today.Why it carries UTM params rather than redirecting to a bare
/A server-side redirect fires no analytics event of its own. Sending
/progressstraight to/would land the scan as an ordinary homepage pageview, indistinguishable from organic traffic — so the ad would be uncountable, which defeats the point of giving it its own URL.Redirecting to
/?utm_source=ooh&utm_medium=offline&utm_campaign=progressmeans GA4 parses those off the landing URL and files the visit under the campaign, so the ad shows up in Reports → Acquisition → Traffic acquisition.Details worth a look
OOH_DESTINATION) so the campaign can be renamed in a single place. Change these if there's an existing naming convention for other campaigns —utm_medium=offlineis what keeps GA4 from filing the visit as "Unassigned"./progress/is covered too.skipTrailingSlashRedirect: trueis set for the PostHog proxy, so the trailing-slash variant doesn't normalize itself and would otherwise 404.Testing
/progressand/progress/→ 307 with params intact, one hop, landing on a 200 homepage./progresssstill 404s, so nothing over-matched. Ran dev with a test measurement ID to confirm the gtag snippet loads on the landing URL with the query string attached.tsc --noEmitandeslintclean.Not verified: the actual GA
collectrequest — the Chrome extension wasn't connected locally. Worth loading/progressonce in GA4 Realtime or DebugView after deploy to confirm the campaign registers, ideally before the ad goes to print.Aside, not fixed here
Client-side PostHog is never initialized —
posthog-jsis imported in 9 components but there's noposthog.init()anywhere insrc, so thoseposthog.capturecalls (pledge, share, subscribe, candidate links) are silent no-ops. That's why this uses GA4. Separate issue.🤖 Generated with Claude Code