Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEO and AJAX #436

Closed
hancush opened this issue May 6, 2020 · 3 comments · Fixed by #441
Closed

SEO and AJAX #436

hancush opened this issue May 6, 2020 · 3 comments · Fixed by #441

Comments

@hancush
Copy link
Member

hancush commented May 6, 2020

On the live site, all processing work is done server-side, so the page loads with data already in place, making it perfectly indexable by Google, et al.

In version two, we're transitioning an AJAX approach to retrieve metadata, such as summary statistics, top earners, and any child departments, based on data year. This means data is not in place at page load, which will impact SEO.

@hancush
Copy link
Member Author

hancush commented May 6, 2020

N.b., Person pages will display all data on load, at once.

@hancush
Copy link
Member Author

hancush commented May 15, 2020

Some initial learning:

  • Provided external JavaScript files are indexable and scripts are valid (i.e., not broken), Google will render JavaScript.
  • Google indexes both raw and rendered HTML in "waves".
    Diagram of Google search indexing process
  • It's advisable to push pushState or replaceState (the JavaScript history API) to update URLs when a JavaScript interaction changes page content. Do not use hash navigation! Google considers it a hack, and any content after the hash is ignored.
  • Some instances where dynamic content will not be indexed:
    • JavaScript is broken
    • Content is hidden behind user interaction (Google will only index content displayed on page load)
    • Content takes longer than 5 seconds to load

Links:

@hancush
Copy link
Member Author

hancush commented May 15, 2020

Action items here:

  • Update employer pages to default to most recent year data is available.
  • Build real URLs corresponding to data year via the JavaScript history API.
  • Ensure API content loads quickly enough (Improving API efficiency #437).
  • Add a description meta tag to entity pages. The result snippet is currently FUGLY.

Screen Shot 2020-05-15 at 10 01 02 AM

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 a pull request may close this issue.

1 participant