Depending on what sort of 301 redirect you are doing, you should look into forwarding the referrers in the header, so that this information is passed through to the page that is actually being tracked.
So for example:
- Google Search
- m.domain.com
- header contains "google.com" as the referrer
- m. 301 redirects to www.
- the referrer is not forwarded to the www. site, therefore the referrer is empty ("")
In this scenario, "google.com" was lost during the redirect, and therefore it will be treated like direct traffic
Server-side redirects can often forward header information during the redirect, so that when the user lands on the www version of the site, the referrer from m. is maintained, and the tracking on www. can see that the referrer is "google.com".
If your DevOPs team cannot achieve this, then they might be able to add the referrer as a query parameter, that you would then have to read and build into your reporting... the danger with this is, if that URL with the parameter is bookmarked, shared, or otherwise picked up by Google, you will actually be sending people directly to those URLs and reporting on them incorrectly... and that could actually last for years, instead of the possibility of some data loss over a few months while your mobile site loses SEO value and your www site gains the traffic naturally....