Automattic / Automattic/jetpack

Related Posts: Option to leave tracking URLs

Open
#3,038 8 comments 0 reactions 0 assignees View on GitHub
[Feature] Related Posts Enhancement
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

Related Posts adds tracking args to the URL when clicking on a RP:

```
var args = 'relatedposts_hit=1';
args += '&relatedposts_origin=' + $( anchor ).data( 'origin' );
args += '&relatedposts_position=' + $( anchor ).data( 'position' );
```

But then we clean them up. It may be beneficial to some users to leave them so Google and other stats programs have easier access to use that for performance tracking.

Suggestion: Add a filter that sets a variable that gets localized into JS to determine if `cleanupTrackedUrl` is fired or not.

@xyu thoughts?

Contributor guide

Open the contributing guide

Research direction

Start by locating the Related Posts JavaScript entry point and the cleanupTrackedUrl function shown in the issue, then trace how its tracking setting is localized from PHP. Done means a filter controls whether tracked URL parameters are removed, with coverage confirming both enabled and disabled behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php, wordpress
Domain
analytics, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.