Skip to content

[Feature]: handle ?ref & ?utm_source as fallback values for referer header #236

@JonasDoesThings

Description

@JonasDoesThings

Feature Summary

Hey, I think it would be good to use the query parameters "?ref=" and "?utm_source" (and potentially also ?source) as values for the referer if the header is not present.

To implement this, we would need to extend the logic in the tracker's getBrowserReferrer function.

Component

@counterscale/tracker

Additional Context

Plausible checks these parameters, if any of them is present, they are used instead of the referrer header:

tagged_source =
      request.query_params["utm_source"] ||
        request.query_params["source"] ||
        request.query_params["ref"]

source.ex#L54

Pirsch Analytics checks the Referrer header first, and uses these parameters if the Referrer header is null or empty:

export const PIRSCH_REFERRER_QUERY_PARAMETERS = ["ref", "referer", "referrer", "source", "utm_source"] as const;

constants.ts#L5

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions