Closed hamirmahal closed 6 months ago
$initial_referrer
and $initial_referring_domain
should include "github"
, no?
@tdumitrescu is this the intended behavior?
Hi, @hamirmahal. It looks like in this case that the default Referrer-Policy prevents the Referer header from being sent when clicking the link because the browser is requesting an HTTP protocol resource from an HTTPS resource.
You can check the value of document.referrer
in the console to confirm that the Referer value is empty. We can't determine why it's empty, so any empty value will be treated as "$direct"
.
Hmm... I notice this issue even when going from one HTTPS resource, https://github.com/hamirmahal/FilmFinder, to another HTTPS resource, https://hamirs-filmfinder.vercel.app/.
How does Mixpanel recommend tracking the source of page views?
Hmm... I notice this issue even when going from one HTTPS resource, https://github.com/hamirmahal/FilmFinder, to another HTTPS resource, https://hamirs-filmfinder.vercel.app/.
You'll see it's common for sites to add a "noreferrer" attribute to external links, which will also prevent the referrer from being provided. Here's the HTML for the link you clicked from GitHub where you can see that's what's happening.
<a title="https://hamirs-filmfinder.vercel.app/" role="link" target="_blank" rel="noopener noreferrer nofollow" class="text-bold" href="https://hamirs-filmfinder.vercel.app/">
hamirs-filmfinder.vercel.app/
</a>
How does Mixpanel recommend tracking the source of page views?
Besides looking at referrer, the most common way to track incoming traffic sources is through UTM parameters that you add to your links. The Mixpanel SDK will pick those up and automatically add those to the page view events. So if someone visited a link such as https://hamirs-filmfinder.vercel.app/?utm_source=github
, then our page view events will track utm_source as an event property.
Ah, that makes sense. Thank you for the help.
When using utm_source
to track links to a page, I noticed that utm_source
can stick around in the URL in the user's address bar after navigating to a page.
Is there a recommended, or industry-standard way to remove, or clean that from the URL after using utm_source
to track where traffic came from?
I don't know about standards, but many websites just leave them in the URL after a user lands. With Mixpanel tracking, it can be useful to have the UTM parameters recorded on any events that are fired while the user is on the same page.
You could manually remove those query parameters using the browser history API after the customer lands, but how you approach that will depend on the rest of your data needs.
Problem
Screencast from 03-17-2024 02:50:46 PM.webm