As we are moving from the classic Google Analytics to the Universal Google Analytics for the marketing requirement, I need to find out from where the customer is coming from. If he is coming from the marketing campaigns then we have the param utm_source from URL. So with this I can find out the customer visit. But if the customer is from the Google results, then there will be no extra parameters added to the URL.

Because of this, I am unable to differentiate whether the customer is from the Google results or from the direct URL visit. My idea is to use, HTTP_REFERRER. But this will result in lot of requests to server for each page load which results in unnecessary load on server.

Universal Google Analytics does support _utmz cookies. It will only supported in classic Google Analytics. So is there any better way to differentiate the customer visit from the Google results and the direct URL visit?


First of all the HTTP referer will be on the server so your server side code would handle it at page load time. Secondly this option won't work anymore due to Google adopting SSL for all pages and search results. As part of the RFC it states that the referrer header should not be sent by the browser if the connection is going from https to http. (https://isc.sans.edu/forums/diary/When+does+your+browser+send+a+Referer+header+or+not/16433)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.