matomo-org / matomo-org/developer-documentation

Update the single-page-tracking tutorial

Open
#272 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Documentation
Dominant language
PHP
Stars
58
Forks
88
Avg merge
6d 3h
Merged PRs (30d)
13

Description

This page is talking about how to use Matomo in SPAs, but it's referring only to hashchange style navigation.

These days, SPAs are almost exclusively using pushState navigation, so it would make sense to update the documentation. The main points are:

  1. Whenever your app is calling pushState or replaceState, you might want to call the trackPageView method
  2. Then you probably want to listen to window.popstate events and send a trackPageView message as well

Most of the page can stay as it is, I would just replace the bits about hashchange with pushState.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the single-page-tracking tutorial at developer.matomo.org/guides/spa-tracking and review its existing hashchange guidance. Update the relevant sections to cover pushState and replaceState with trackPageView, and popstate events with trackPageView calls. Done means the tutorial accurately explains these SPA navigation patterns while preserving the useful existing content.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.