Referer-Policy header is set up correctly to support this.
Example use cases
Here are some examples of how you can use the full referer URL data to make data-driven decisions:Tracking internal traffic
You can use the full referer URL data to track internal traffic. For example, we recently replaced the Sign Up button in our nav bar with a Dub-powered link (d.to/register). This gave us insight into which pages sent the most traffic to our signup page:
You can check out the live demo for yourself here.
Tracking product-led growth
Say you run a SaaS product with dynamic user-generated content/web-pages. Here are some examples:- Dub’s public analytics dashboards (e.g.
d.to/stats/try) - Cal.com’s booking pages (e.g.
cal.com/peer) - Product Hunt’s launch pages (e.g.
producthunt.com/posts/dub)
d.to/register link above:
How to enable full referer URL tracking (via Referer-Policy header)
To enable full referer URLs, you need to make sure your site has the correct Referer-Policy header set. There are a few ways to configure this, depending on your application framework:Using Next.js
If you are using Next.js, you can use theheaders property in your next.config.js file to configure the referer policy.
next.config.js
Using Nuxt
If you are using Nuxt, you can use therouteRules property in your nuxt.config.ts file to configure the referer policy:
nuxt.config.ts
Using Laravel
If you are using Laravel, you can use the Laravel Security Middleware to configure the referer policy.app/Http/Middleware/SetReferrerPolicy.php
Using Flask
If you are using Flask, you can set theReferrer-Policy header for all requests like this:
app.py
app.py
Using a Meta Tag
Alternatively, you can also set the referer policy using a meta tag in the<head> section of your HTML: