Skip to content

Update Locate Button to navigate to Book Page section #12105

@mekarpeles

Description

@mekarpeles

Issue Refinement

Summary

The "Locate" button currently redirects patrons off-site to WorldCat when a book isn't available to borrow or read on Open Library. This issue proposes keeping those patrons on-site by redirecting the button to the OL edition/book page itself, specifically to a section surfacing price/vendor purchasing options and nearby library availability. Given the button receives hundreds of thousands of clicks, this is a meaningful retention opportunity and could improve discoverability of the already-existing vendor and library data we surface on edition pages.

The proposal is directionally clear but technically underspecified — the "locate section" it refers to may already partially exist (the edition page has both WorldcatLink and affiliate buy links in a mobile-vendor panel), but it's unclear whether those sections need to be redesigned, promoted, or if a new anchor-targeted section is needed.


Requirements

  • Determine whether the existing edition page vendor/library sections (WorldCat link + affiliate links) are sufficient as a "locate" destination, or if a new dedicated section is needed
  • Change the Locate button href from /books/{key}/-/borrow?action=locate to /books/{key}#locate (or equivalent anchor)
  • Optionally: remove or repurpose the action=locate server-side redirect in borrow.py (L126–127)
  • The "locate" section on the edition page should prominently surface: nearby library availability (currently WorldCat link) + purchase options (currently affiliate links)
  • Confirm the section renders correctly for editions missing ISBN/OCLC identifiers (graceful degradation)
  • Verify analytics tracking — current data-ol-link-track="CTAClick|Locate" should continue working

Success Criteria

  • Clicking "Locate" no longer sends patrons to WorldCat; they stay on the OL edition page
  • The edition page "locate" destination contains meaningful library and vendor data
  • Analytics confirm a measurable reduction in off-site WorldCat referrals and/or improvement in on-site session continuity
  • All existing tests pass; LocateButton continues to render in search results, carousels, and the edition read panel

Relevant Files, Components, & Changes

Reference commits (upstream internetarchive/openlibrary):

  • #9952 — closed Dec 2024, introduced LocateButton.html and the borrow?action=locate flow in the first place (by @SivanC). This is the direct predecessor to this issue.

Related Issues, PRs, Dependencies


Risks, Considerations, Uncertainties

  1. WorldCat still in the loop: The edition page's WorldcatLink macro still links out to WorldCat. This issue may partially address off-site exits but doesn't eliminate them — worth discussing whether WorldCat links on the book page itself should also eventually be replaced.
  2. Editions without rich metadata: Editions lacking ISBN/OCLC/affiliate data will have a sparse or empty "locate section." The UX for those cases needs explicit design consideration.
  3. Search results / carousels: The LocateButton renders in non-edition contexts (search, carousels) where there's no full edition page sidebar. A redirect to /books/{key} from those surfaces should still work, but the anchor behavior needs verification.
  4. Analytics continuity: The current CTAClick|Locate tracking fires on the button click regardless of destination. If the URL changes significantly, ensure the tracking attribute still fires.
  5. Performance: The edition page has render timers. Adding a prominent new section may require caching consideration, especially if vendor/library API calls (BetterWorldBooks, etc.) are invoked on more page loads.
  6. Proposal vagueness: The issue body has empty Proposal and Requirements Checklist fields. This needs fleshing out before a contributor picks it up.

🔔 Stakeholders Notified

  • @mekarpeles — issue author and program lead; the "hundreds of thousands of clicks" data point likely came from internal analytics, needs to provide destination spec
  • @cdrini — owns search/editions infrastructure; Locate button renders in search results and carousels, changes there need his eyes
  • @lokesh — front-end/design lead; if a new "locate section" needs to be designed or the edition page sidebar needs redesign, this is his domain

Prescriptions

  • Needs: Breakdown is correctly applied — the proposal lacks a concrete spec for what the "locate section" looks like on the book page. Before a contributor starts, someone needs to answer: does the existing mobile-vendor panel suffice, or does a new #locate anchor section need to be built?
  • Needs: Lead is correctly applied — this touches a high-traffic CTA and requires a product-informed decision on destination design.
  • The mechanical change in borrow.py and LocateButton.html is straightforward (~2–3 lines), but the design/scope of the destination section is the real work.
  • Once scoped, the backend change (removing the action=locate redirect) could be a Good First Issue in isolation.

Breakdown

Implementation Details (for maintainers)

Related files

Refer to this map of common Endpoints:
*

Requirements Checklist

Checklist of requirements that need to be satisfied in order for this issue to be closed:

  • [ ]

Stakeholders


Instructions for Contributors

Metadata

Metadata

Assignees

Labels

Lead: @cdriniIssues overseen by Drini (Staff: Team Lead & Solr, Library Explorer, i18n) [managed]Priority: 2Important, as time permits. [managed]Theme: Affiliate APIType: Feature RequestIssue describes a feature or enhancement we'd like to implement. [managed]

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions