How does direct traffic work?

Direct traffic is a Google Analytics session (or visit) that starts without a referrer being passed by a user’s web browser.

In order to understand how the direct traffic works, you would first need to understand the concept of a ‘referrer’. 

In order to understand ‘referrer’ you first need to understand HTTP. So let us first start with HTTP and then we will gradually move to ‘referrer’.

Introduction to HTTP and referrer

HTTP or Hypertext Transfer Protocol is a set of rules used by web browsers and web servers to communicate with each other.

A web browser communicates with a web server by sending HTTP requests for each requested resource (HTML document, image file, CSS file, JavaScript file, etc).

A web server communicates back by sending HTTP responses for each HTTP request. Each HTTP request is made up of request lines and request headers (also called HTTP request headers).

Similarly, each HTTP response is made up of status line and response headers (also called HTTP response headers).

This is what an HTTP request looks like:

This request was made to my web server (where my website is hosted) by a user’s browser when he clicked on a link to one of my blog posts (You are doing Google Analytics all wrong. Here is why) from my Google+ page.

As so you can see from the screenshot above, the referrer is just one of the HTTP request header and it is ‘Google Plus’ in this case:

https://plus.url.google.com/url?sa=z&n=1400603604168&url=http%3A%2F%2Fwww.optimizesmart.com%2Fgoogle-analytics-wrong-why&usg=ZSnkIqTswUCpggL84jvJcY3KXfk

Now since the request was made to my webserver, my server has to communicate back (it has to obey HTTP protocols) to the user’s browser. It does so by sending an HTTP response.

This is what an HTTP response looks like:

This response was sent by my webserver to the user’s browser.

Get the E-book (52 Pages)

Get the E-Book (37 Pages)

 

How to see the HTTP request and response headers

You can’t see HTTP request and response headers by just viewing the source code of a web page. You won’t find them there.

I use a tool called ‘Chrome Developer Tools’ to see HTTP requests and responses for a particular web page. This tool is already built into Google Chrome browser.

Follow the steps below:

Step-1: Right-click on a web page and then select ‘Inspect’:

This will open the developer’s tool window at the bottom of your browser.

Step-2: Click on the ‘Network’ tab:

Step-3: Press F5 to reload your web page or click on the browser refresh button.

Step-4: Find and click on the URL of your webpage:

Step-5: Click on the ‘headers’ tab:

On the right-hand side of the developer’s window, you can see all the HTTP response and request headers.

Scroll down and search for ‘Referrer‘ in the HTTP request header:

This is the window from which you can find out whether a referrer was passed or not.

Note: Cookie is one of the HTTP request header (see the screenshot above). So cookie data is sent via an HTTP request to a web server.

If your website is on https:// and you are linking out or redirecting to another https:// website, your browser will send referrer data. Similarly, if your website is on http:// and you are linking out or redirecting to an https:// website, your browser will send referrer data.

HTTPs and referrer

HTTPS or Hypertext Transfer Protocol Secure is simply a secure version of the HTTP.

If your website is on https:// and you are linking out or redirecting to an http:// website, your browser will not send referrer data because of security reasons.

What that means, all of the HTTP websites you are sending the traffic to will see traffic from your HTTPS website as direct traffic. However, if your website is on https:// and you are linking out or redirecting to another https:// website, your browser will send referrer data because both websites are using a secure connection.

Following is the visual summary of when a referrer data is passed and not passed in case of HTTPS and HTTP connections:

So if one day, all websites move to HTTPS while your website won’t then you will lose the majority of your referrer data for good as HTTPS websites by default, do not pass referrer data to HTTP websites.

I used the word ‘default’ because it is possible to send referrer data from an HTTPS website to an HTTP website.

How to send referrer data from an HTTPS website to an HTTP website

As mentioned earlier, you can send referrer data from an HTTPS website to an HTTP website. For example, Google, Facebook and Twitter are already sending referrer data to HTTP websites and they all use https://

How they are able to do that? They all use an internal redirect script that first redirects a visitor to an HTTP page (which creates its own referrer data) before sending the visitor to the actual URL on an HTTP website.

For example, if you click on this link:

http://www.abc.com/excel-seo-powerful-cheat-sheet-boost-productivity/

from the following Google+ page:

https://plus.google.com/109426632283601974817/posts

you will first be temporarily redirected to the following URL:

http://plus.url.google.com/url?sa=z&n=1400603253616&url=http%3A%2F%2Fwww.abc.com%2Fexcel-seo-powerful-cheat-sheet-boost-productivity%2F&usg=Yr4dTmDnq34M5t5_Y93W7CqqLJk

Then you will be redirected to:

http://www.abc.com/excel-seo-powerful-cheat-sheet-boost-productivity/

All of this will happen so fast, that you can’t easily identify that you were first redirected to an intermediate HTTP page. 

Here Google+ is not sending the original referral data from an HTTPs website to an HTTP website thus honouring the Secure Protocol which states that:

If a website is accessed from an HTTP Secure (HTTPS) connection and a link points to anywhere except another secure location, then the referer field is not sent.

Source: https://en.wikipedia.org/wiki/HTTP_referer

So what Google+ is doing here is, creating its own referrer data by using an intermediate page (http://plus.url.google.com/url?) something like this:

<a href=”http://plus.url.google.com/url?sa=z&n=1400603604168&url=http%3A%2F%2Fwww.abc.com%2Fexcel-seo-powerful-cheat-sheet-boost-productivity&usg=ZSnkIqTswUCpggL84jvJcY3KXfk”>https://www.abc.com/excel-seo-powerful-cheat-sheet-boost-productivity/</a>

Facebook and twitter follow the same tactic. They create and send their own referrer data instead of the original referrer data. Facebook uses facebook.com/l.php as an intermediate page, whereas twitter uses t.co/ as an intermediate page.

Now since these social networks do not send the original referrer data, they can rewrite the referrer data whatever way they want and can hide any information they like. Another advantage of using this tactic is that these social networks can easily hide personally identifiable information and can thus protect users’ privacy.

Google Search Engine also use the same tactic as it redirects you through another URL. That is why even when being on a secure connection, Google is able to send referrer data to HTTP websites. 

Since Google doesn’t send you the original referrer data, it can also rewrite the referrer data whatever way it wants and can hide any information it likes. So Google chooses to hide the ‘keyword’ data from its referrer via ‘not provided’ keywords.

You can use the same tactic to send referrer data from your HTTPS website to any HTTP website.

What referrer data are search engines sending to an HTTP website?

If you want to know what referrer data search engines (like Google, Bing and Yahoo) are sending to an HTTP website, then follow the steps below:

Step-1: Install the Get Referrer URL chrome extension. When you install the extension, it appears as a letter ‘R’ on top right-hand side of your browser:

Step-2: Search for a keyword phrase for which your HTTP website rank on the first page of Google and then click on your website listing in the search results.

Step-3: Click on the ‘R’ button to see the referrer URL:

You can also use the ‘Get Referrer URL chrome extension’ when you navigate from one web page of your website to another. If you do not see the referrer URL then it means the traffic to another page is treated as direct traffic by Google Analytics:

Related Articles:

Register for the FREE TRAINING...

"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."



Here’s what we’re going to cover in this training…

#1 Why digital analytics is the key to online business success.

​#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.

#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.

#4 ​Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your business.

#6 How to advertise on any marketing platform for FREE with an unlimited budget.

​#7 How to learn and master digital analytics and conversion optimization in record time.



   

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and Beyond
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

Himanshu Sharma

Digital Marketing Consultant and Founder of Optimizesmart.com

Himanshu helps business owners and marketing professionals in generating more sales and ROI by fixing their website tracking issues, helping them understand their true customers' purchase journey and helping them determine the most effective marketing channels for investment.

He has over 12 years of experience in digital analytics and digital marketing.

He was nominated for the Digital Analytics Association's Awards for Excellence. The Digital Analytics Association is a world-renowned not-for-profit association that helps organisations overcome the challenges of data acquisition and application.

He is the author of four best-selling books on analytics and conversion optimization:

error: Alert: Content is protected !!