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

Add referrer overwriting #54

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Khodl
Copy link

@Khodl Khodl commented Feb 12, 2025

This change should allow the admin to overwrite the domain. It would also solve #48 by allowing the server to include the referrer provided by Cloudflare server-side.

⚠️ As I am not really familiar with that stack, I did not test it.

@adriaandotcom
Copy link
Collaborator

adriaandotcom commented Feb 12, 2025

I think that referrer should be changed for any further pages, right?

Otherwise it's always the page before landing.

Hm, it seems to always be the page before landing anyway.

@Khodl
Copy link
Author

Khodl commented Feb 12, 2025

From my understanding, here is the current scenario with Cloudflare when I arrive at my website (Untalent) from Google:

  • Captcha page:

    • SimpleAnalytics script: not loaded?
    • Server referrer: n/a, Cloudflare manages this page
    • Client referrer: n/a, handled by Cloudflare
    • → Redirects to the next page.
  • Next page:

    • SimpleAnalytics script: loaded.
    • Server referrer: Google (as provided by Cloudflare's proxy)
    • Client referrer: Untalent, with the cf parameter.

So, at the moment, there is one pageview counted, and since it is considered an internal link, it will not be counted as a new visit.

With the referral overwrite, the only difference is:

  • Next page:
    • Client referrer: Google (overwritten).

I am not 100% sure about this, so please take it with a pinch of salt.

@adriaandotcom
Copy link
Collaborator

Compiled version: https://gist.github.com/adriaandotcom/bc456c1e046294c6ed8f51e9793351c4

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 this pull request may close these issues.

2 participants