Skip to content

Inaccurate click tracking due to HEAD requests from platforms like Twitter/X #2309

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

Closed
BharathxD opened this issue Apr 16, 2025 · 4 comments
Closed

Comments

@BharathxD
Copy link
Contributor

I noticed something weird with my link analytics that I wanted to bring to your attention. My shortened links are showing significantly more clicks than actual visitors, and I think I've figured out why.

This appears to be related to Issue #1860 about false link counts, but I've identified the specific mechanism causing the problem.

When I share links on Twitter/X, I'm seeing multiple clicks recorded instantly, even though nobody has opened them. After investigating, I found that X sends one GET request (from TwitterBot) followed by three HEAD requests for each shared link. These HEAD requests are being counted as actual clicks, inflating my analytics.

Image Image

These HEAD requests use standard browser user agents (sometimes with different IPs) rather than bot identifiers:

  • iPhone Safari user agent
  • Desktop Chrome user agent
  • Empty user agent

I tested the same thing with Rebrandly and noticed they don't count HEAD requests as clicks, which makes sense since these are just automated platform checks, not real user interactions.

To confirm this wasn't a fluke, I:

  • Shared multiple links on different platforms
  • Checked server logs to verify the request patterns
  • Tested with Postman using different HTTP methods

The fix seems pretty straightforward - you're already filtering out bots, but you should also filter out HEAD requests since these aren't actual user interactions but just metadata checks.

Copy link

linear bot commented Apr 16, 2025

@steven-tey
Copy link
Collaborator

Really phenomenal investigation + analysis + fix here @BharathxD, thank you so much! Excluding HEAD requests from being tracked makes a lot of sense – we'll get your PR reviewed and merge it soon 🙏

@steven-tey
Copy link
Collaborator

Merged #2310 – thank you so much!

@BharathxD
Copy link
Contributor Author

Thank you, Steven! I appreciate the kind words and your time reviewing the PR.

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

No branches or pull requests

2 participants