Feature Description
Internal Site Kit deep links within the PDF (e.g. the "View on dashboard" CTA, plus the entity-dashboard links embedded in Key Metrics page lists, Audience Segmentation tiles, Top Content over Time, and Top Earning Pages) use the GoLinks system so that if Site Kit's internal URL patterns change in future, baked-in PDF links still resolve. External destinations (Google privacy policy, Site Kit help center, Search Console search.google.com links) are NOT proxied through GoLinks - they point directly to their canonical URLs since they do not benefit from the WordPress admin auth flow and are stable Google-owned URLs.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- Every internal Site Kit deep link a user clicks inside a downloaded PDF (the "View on dashboard" link, plus every page-entity link in Key Metrics, Audience Segmentation, Top Content, and Top Earning Pages) redirects through Site Kit's GoLinks system rather than going to a hard-coded destination, consistent with how Email Reporting internal links behave today.
- If a user clicks an internal GoLink in a PDF while logged out of WordPress, they go through the standard WordPress authentication flow before landing on the destination (same behaviour as existing Email Reporting links).
- External links inside the PDF (Google privacy policy, Site Kit help center, Search Console destinations on
search.google.com) point directly to their canonical URLs and are NOT proxied through GoLinks.
Implementation Brief
Frontend (JavaScript) - client-side GoLinks helper
Test Coverage
- Jest:
assets/js/googlesitekit/datastore/site/golinks.test.ts - getGoLinkURL returns the expected URL shape for the dashboard key (no args), the entity-dashboard variant ({ permaLink: 'https://example.com/page' } appends permaLink correctly, including URL-encoding), handles arbitrary extra query args, and still produces a URL for unknown keys (server decides validity at click time).
QA Brief
Changelog entry
- Add the
getGoLinkURL( key, args = {} ) selector to the CORE_SITE datastore.
Feature Description
Internal Site Kit deep links within the PDF (e.g. the "View on dashboard" CTA, plus the entity-dashboard links embedded in Key Metrics page lists, Audience Segmentation tiles, Top Content over Time, and Top Earning Pages) use the GoLinks system so that if Site Kit's internal URL patterns change in future, baked-in PDF links still resolve. External destinations (Google privacy policy, Site Kit help center, Search Console
search.google.comlinks) are NOT proxied through GoLinks - they point directly to their canonical URLs since they do not benefit from the WordPress admin auth flow and are stable Google-owned URLs.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
search.google.com) point directly to their canonical URLs and are NOT proxied through GoLinks.Implementation Brief
Frontend (JavaScript) - client-side GoLinks helper
assets/js/googlesitekit/datastore/site/golinks.ts- adds agetGoLinkURL( key, args = {} )selector toCORE_SITE. Returns{adminURL}/index.php?action=googlesitekit_go&to={key}with any extra query args appended (e.g.permaLinkfor entity-dashboard links). Pure URL construction - no REST round-trip - because the shape is deterministic from the admin URL plus the handler key (seeGolinks::get_urlon the PHP side). Single place where the GoLink URL shape is defined on the client. Used by the PDF's "View on dashboard" CTA and by every entity-dashboard link in the Key Metrics page lists, Audience Segmentation tiles, Top Content over Time, and Top Earning Pages widgets. Search Console destinations (search.google.com) and other external URLs (privacy policy, help center) bypass this selector and link directly.assets/js/googlesitekit/datastore/site/index.js- register the newgolinkssub-store alongside the existingurls,info, etc.Test Coverage
assets/js/googlesitekit/datastore/site/golinks.test.ts-getGoLinkURLreturns the expected URL shape for thedashboardkey (no args), the entity-dashboard variant ({ permaLink: 'https://example.com/page' }appendspermaLinkcorrectly, including URL-encoding), handles arbitrary extra query args, and still produces a URL for unknown keys (server decides validity at click time).QA Brief
assets/js/googlesitekit/datastore/site/golinks.test.ts, and the server-side redirect bytests/playwright/specs/golinks.spec.ts.#1and AC#3land with consumer tickets Core pipeline: Export an MVP PDF #12536, Implement the PDF header (without internal links) #12552, Implement the PDF Report footer #12557.Changelog entry
getGoLinkURL( key, args = {} )selector to theCORE_SITEdatastore.