Overwrite path edit

Download PDF

Let’s say you want to change the path of your page views (and events). You have profiles of users on your website (https://example.com/profiles/@adriaan), but don’t want to see the profile name in your dashboard. But you do want to record that profiles did get visits.

You can not overwrite the hash from the URL, only the path.

This is how you set up a myPathOverwriter-function for that usecase:

  function myPathOverwriter({ path }) {
    if (path.startsWith("/profiles/")) path = "/profiles/***";
    return path;

You can specify the path callback function via data-path-overwriter, in the example above, you specify the myPathOverwriter-function. The function gets an object as argument in which you find the path key. If the function errors or it returns a falsy value, we keep the original path.

If you want to omit those page views completely, you can use our ignore pages feature.