How to Track Lead Source and Referrer.

Posted on 2012-04-12
Last Modified: 2012-04-27
Hi, My client has a website and an enquiry form. Every time he gets an enquiry he wants to track where the lead came from (Referrer [can be a search engine or a 3rd party advertiser]), the keyword they used, the search engine used, the landing page etc etc.

Whats the best solution out there for this? I'm pretty good with PHP and Javascript. Tried using Google Analytics cookies, they are not that accurate.

Thanks guys in advance.
Question by:udara22
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 17

Expert Comment

by:Kent Dyer
ID: 37840874
You need a database..  If you have MySQL you should be set.

Use your database as your source of record..
You need a login/password
Data Entry Screen
Edit Screen



Author Comment

ID: 37840883
Hi Kent, Thanks. I have a Joomla website running. I used Google Analytics cookies to extract data and store into the database next to each of the enquiries in the Joomla backend. its all set.

But the issue is not storing information. The issue is which technology to use to grab the user information?

LVL 17

Expert Comment

by:Kent Dyer
ID: 37840904
OK..  you need to do the CRUD principle to your database..  You have to be "C"reate (INSERT) into the database..  You have to "R"ead (SELECT) from the database..  You have to be able to "U"pdate and "D"elete..  If you can login to phpMyAdmin, you should have the db connectors from your pHP pages..

Not sure what else I can provide?

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.


Author Comment

ID: 37840965
Kent, how can I grab what users typed on google?
LVL 36

Expert Comment

ID: 37841338
I'm a little surprised that Google Analytics is inaccurate with regards to this, as I would imagine referrers to be high on the list of things it provides.

Nonetheless, if your users came from Google, which holds the user's query string in the URL, you can grab it.

With PHP, you can refer to the $_SERVER['HTTP_REFERER'] superglobal and parse it to obtain the query string. See for some more details on one way to do this.
LVL 110

Expert Comment

by:Ray Paseur
ID: 37843731
Kent, how can I grab what users typed on google?
You probably can't.  And I am not sure that Google would want you to have this information -- it's their proprietary business data.  I believe that Google Analytics will be one of your best tools.  You can capture some additional information if you want to get into cross-platform cookie tracking.  Learn about Undertone Networks and DoubleClick.  I am assuming that if you have foreign sites that advertise and refer clients, you are already tracking this via the request link, right?  You can get a little more information if you look in $_SERVER['HTTP_REFERER'].

Author Comment

ID: 37844024
@Ray_Paseur : Hi Ray and Zylock. The issue with Google Analytics is, sometimes its referer and keywrod cookie (__utmz) doesnt get updated if the user has visited the website before.  For an example, if I go to Google and type "keyword one" and land on my website and the google cookie is set referer to "Google", and if I go and click on a 3rd party advertising banner right after that, sometime google still has referer as "Google". This happends a lot on IE 7. So thats why I was looking for a more PHP based solution rather than cookie and JS based.

My media agency uses DoubleClick. But its just for media agencies isnt ? Not fur standard consumers?

Accepted Solution

udara22 earned 0 total points
ID: 37879678
Sorry, not quite what I expected.

Author Closing Comment

ID: 37901245
Sorry, not quite what I expected.

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SharePoint and CAML query help 4 26
Woo-commerce gallery not working properly 12 42
PHP MYSQLI Connection in Function in a class 4 29
Undefined variable with $_POST in PHP 5 40
In this blog, I will share you some basic tips for content marketing and to rank your website on Google.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question