Skip to content

Add referrer overwriting - #54

Closed
Khodl wants to merge 1 commit into
simpleanalytics:mainfrom
Khodl:referrer-overwrite
Closed

Khodl wants to merge 1 commit into
simpleanalytics:mainfrom
Khodl:referrer-overwrite

Conversation

@Khodl

@Khodl Khodl commented Feb 12, 2025 •

Copy link
Copy Markdown

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

adriaandotcom commented Feb 12, 2025 •

Copy link
Copy Markdown
Collaborator

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

Khodl commented Feb 12, 2025

Copy link
Copy Markdown
Author

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
Copy Markdown
Collaborator
@adriaandotcom

adriaandotcom commented May 29, 2025 •

Copy link
Copy Markdown
Collaborator

Included in #40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants