HTTP Referrer

The Referrer-Policy HTTP header controls how much referrer information (sent via the Referer header) should be included with requests.

Read more at developer.mozilla.orgarrow-up-right

Iris uses the Shopify's goreferrerarrow-up-right package to expose the Context.GetReferrer() method.

The GetReferrer method extracts and returns the information from the "Referer" (or "Referrer") header and url query parameter as specified in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policyarrow-up-right.

GetReferrer() Referrer

Which Referrer looks like that:

type Referrer struct {
        Type       ReferrerType
        Label      string
        URL        string
        Subdomain  string
        Domain     string
        Tld        string         
        Path       string              
        Query      string                 
        GoogleType ReferrerGoogleSearchType
}

The ReferrerType is the enum for a Referrer.Type value (indirect, direct, email, search, social). The available types are:

ReferrerInvalid
ReferrerIndirect
ReferrerDirect
ReferrerEmail
ReferrerSearch
ReferrerSocial

The GoogleType can be one of those:

Example

How to curl:

Last updated

Was this helpful?