Jump to content
Sign in to follow this  
Sandbag

[Contribution] Leapfrog - Dynamic Visitor Tracking

Recommended Posts

Just updated to the new version. It has now some of the features that I manually added to the first version like visitors country and info on the visitors (spider, guest or logged in customer).

 

I also like to know the selected language of a page. As I stated earlier in this thread I just added a new field to the database table to record the language id and changed the function to add this little info to the page title string.

 

To be honest, I liked leapfrog opening a new page better. Like this if I do something in my admin panel and go back to leapfrog it starts registering visitors clicks from scratch instead of continuing the last "session".

 

Also there is a bit of code missing now. The first version had the manufacturers title included. Just added that back in.

 

Thanks again for a great contribution!

 

abra


The First Law of E-Commerce: If the user can't find the product, the user can't buy the product.

 

Feedback and suggestions on my shop welcome.

 

Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.

Share this post


Link to post
Share on other sites
I also like to know the selected language of a page. As I stated earlier in this thread I just added a new field to the database table to record the language id and changed the function to add this little info to the page title string.

 

I didn't forget you requested this. But I wasn't sure enough people wanted it to add it to the software. Does the page title not show in the translated language?

 

To be honest, I liked leapfrog opening a new page better. Like this if I do something in my admin panel and go back to leapfrog it starts registering visitors clicks from scratch instead of continuing the last "session".

 

I have mixed feelings about this. Not sure which one I prefer. The black looks cooler but the integration with the admin screens work well. I think you will just have to open the Leapfrog page in a new browser window.

 

Also there is a bit of code missing now. The first version had the manufacturers title included. Just added that back in.

 

Not sure what you mean by this. I don't remember the manufacturers title ever being shown in the Leapfrog GUI - can you explain a bit further?

Edited by Sandbag

Share this post


Link to post
Share on other sites

The language: The page titles are in the respective language for pages like shipping.php etc. But my products have the same title (German product name) with a translation in the product description as my customers are more likely to look for the German name than for any kind of translation ("Käsekuchenhilfe" instead of "cheese cake help"). So for these pages I definitely need the page language.

 

About opening a new page... this is what I'm doing right now. I just have to remember not to use the left column to navigate to other parts when on the leapfrog page. It'll do for now. You are right, I liked the dark page.

 

The manufacturer code. Looks like I put that in myself. o:) My shop is heavily modified with the standard categories/manufacturers boxes replaced by dropdown lists (avsearch contrib). The results of the selection are displayed using the index.php (as usual). I just wanted to know if someone is looking at a manufacturers product listing as the standard title would be "Let's see what we have here". Maybe you would like to add that to the next version?

 

In catalog/includes/functions/leapfrog.php replace this:

        } elseif ($HTTP_GET_VARS['cPath']) {

             // Visitor is browsing categories
             $cPath = $HTTP_GET_VARS['cPath'];
             $cPath_array = tep_parse_category_path($cPath);
             $cPath = implode('_', $cPath_array);

             $current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
             $page_desc_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES_DESCRIPTION .
                                             " cd, " . TABLE_CATEGORIES . " c " .
                                                                             " where cd.categories_id = '" . $current_category_id . "' and cd.language_id = '" .
                                                                             $languages_id . "' and cd.categories_id = c.categories_id");
             $page_desc_values = tep_db_fetch_array($page_desc_query);
             $page_desc = $page_desc_values['categories_name'];
             $page_thumb = $page_desc_values['categories_image'];

         } else {

with this:

        } elseif ($HTTP_GET_VARS['cPath']) {

             // Visitor is browsing categories
             $cPath = $HTTP_GET_VARS['cPath'];
             $cPath_array = tep_parse_category_path($cPath);
             $cPath = implode('_', $cPath_array);

             $current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
             $page_desc_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES_DESCRIPTION .
                                             " cd, " . TABLE_CATEGORIES . " c " .
                                                                             " where cd.categories_id = '" . $current_category_id . "' and cd.language_id = '" .
                                                                             $languages_id . "' and cd.categories_id = c.categories_id");
             $page_desc_values = tep_db_fetch_array($page_desc_query);
             $page_desc = $page_desc_values['categories_name'];
             $page_thumb = $page_desc_values['categories_image'];

         } elseif ($HTTP_GET_VARS['manufacturers_id']){

             // Visitor is looking at a particular manufacturer page
             $page_desc_query = tep_db_query("select manufacturers_name, manufacturers_image from " .
                                                                             TABLE_MANUFACTURERS . " where manufacturers_id = '" .
                                                                             $HTTP_GET_VARS['manufacturers_id'] . "'");
             $page_desc_values = tep_db_fetch_array($page_desc_query);
             $page_desc = $page_desc_values['manufacturers_name'];
             $page_thumb = $page_desc_values['manufacturers_image'];

         } else {

 

abra

Edited by abra123cadabra

The First Law of E-Commerce: If the user can't find the product, the user can't buy the product.

 

Feedback and suggestions on my shop welcome.

 

Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.

Share this post


Link to post
Share on other sites

I understand your points about language id and manufacturer now. I will try and put these ideas into the next release. So far we have:

  • Display page language
  • Display manufacturer
  • Auto delete tracking data after a set period of time

Any more?

Share this post


Link to post
Share on other sites

It's strange. I still get the LDF004 error when I first start Leapfrog and then go on to my store's main page. Then a few clicks in (usually when I finally reach a product page) Leapfrog displays properly.

 

A

Share this post


Link to post
Share on other sites

I didn't dig into the code to see how exactly it is determined that the click belongs to a certain visitor. There is a number before the page title (obviously that's the number of pages loaded for this visitor) but the click number is lower. When does the click number increase? Same goes for the time left of the clicks number.

 

A feature I would like to see is an addition to "Guest". If they were logged in before but are logged out, show the customer name in brackets like this: Guest (Customer Name).

 

Another feature you already mentioned is some stats like: visitor has added something to cart (yes/no) and maybe the cart value.

 

How about adding the landing url in addition to the referal url. Hits from my ads carry some variables in the url that allow me to see which ad they clicked on. It would be nice to see like this if the visitor was referred by organic or paid search results.

 

I know, most of these features are part of the supertracker contribution which I'm using but I really like the dynamic element about leapfrog.

 

abra


The First Law of E-Commerce: If the user can't find the product, the user can't buy the product.

 

Feedback and suggestions on my shop welcome.

 

Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.

Share this post


Link to post
Share on other sites
I understand your points about language id and manufacturer now. I will try and put these ideas into the next release. So far we have:
  • Display page language
  • Display manufacturer
  • Auto delete tracking data after a set period of time

Any more?

 

possibility of interacting with the guest ? I mean by java chat or something ?

Sometimes I see scammers I don't want to be on the website and I feel like saying:<<..don't even think of using your flipping cards on my website, you're just waisting your (and my) time..>> :lol:


Outside links in signatures are not allowed!

Share this post


Link to post
Share on other sites
possibility of interacting with the guest ? I mean by java chat or something ?

Sometimes I see scammers I don't want to be on the website and I feel like saying:<<..don't even think of using your flipping cards on my website, you're just waisting your (and my) time..>> :lol:

 

:lol: This is possible but would require quite a bit of work. Maybe not the next release but sometime in the future.

 

abra - all good suggestions. The click count at the bottom of each visitor box should display the total number of clicks they have made. This is based on sesssion id. Unfortunately, when they switch between SSL and a standard page, the session id changes. This means that the click count resets. This is a bug and needs fixing.

 

The time to the right of the page title updates when the user clicks off that page. It shows how long they spent looking at that page.

Edited by Sandbag

Share this post


Link to post
Share on other sites

- Noticed that if you use any html: <br>,<p>, etc. in your pageHeading on any page that a vistor would visit, it will trip leapfrog and you would then see the "Unable to connect to the database" LDF004 error. :-"

 

The above post: "L" to lower case"l" works both ways.

 

I like the idea also of Cart-Session (Yes/No) and cart total - from abra above,

How about bot UserAgent inplace of [bOT].? googlebot,yahoobot,. or mabe the line where referer is. I like botz.

SEO in a flash.. you made it fun. thanks again, can't wait for the next Ver.!

 

: D

Share this post


Link to post
Share on other sites
I understand your points about language id and manufacturer now. I will try and put these ideas into the next release. So far we have:
  • Display page language
  • Display manufacturer
  • Auto delete tracking data after a set period of time

Any more?

 

1) Remove the "setting" option on the page itself and put on somewhere else so that the page can show to the public just like a "live show"! The whole concept of this flash is to able for any shop owner to showcase its real-time customer to the public (assume you have good hits or otherwise your customer will run away!)

 

2) Option to set own css or color of the page intead of plain white

Share this post


Link to post
Share on other sites

What about making the IP clickable with link to dnsstuff whois ?

 

You know ? I have a problem with sessions: Even though I downloaded and installed the latest spiders.txt I have many robots getting the session_id. I have this on my catalog/functions/leapfrog.php

if ($wo_session_id != 0 ) {
		$insert_query = "insert into leapfrog" .
										" (customer_id, customer_name, session_id, ip_address, click_time, page_url, page_title, referer_url, thumb_url)" .
										' values ("' . $wo_customer_id . '", "' . $wo_full_name . '", "' . $wo_session_id . '", "' . $wo_ip_address .
										'", "' . $current_time . '", "' . $wo_last_page_url . '", "' . $page_desc . '", "' . $referer_url . '", "' . $page_thumb . '")';
     tep_db_query($insert_query);
	}

 

and this on my application_top.php:

 

// start the session

 $session_started = false;

 if (SESSION_FORCE_COOKIE_USE == 'True') {

   tep_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, $cookie_path, $cookie_domain);



   if (isset($HTTP_COOKIE_VARS['cookie_test'])) {

     tep_session_start();


  // user_tracking modifications
  if (!$referer_url) {
   $referer_url = $HTTP_SERVER_VARS['HTTP_REFERER'];
       if ($referer_url) {
           tep_session_register('referer_url');
       }
   }

     $session_started = true;

   }

 } elseif (SESSION_BLOCK_SPIDERS == 'True') {

   $user_agent = strtolower(getenv('HTTP_USER_AGENT'));

   $spider_flag = false;



   if (tep_not_null($user_agent)) {

     $spiders = file(DIR_WS_INCLUDES . 'spiders.txt');



     for ($i=0, $n=sizeof($spiders); $i<$n; $i++) {

       if (tep_not_null($spiders[$i])) {

         if (is_integer(strpos($user_agent, trim($spiders[$i])))) {

           $spider_flag = true;

           break;

         }

       }

     }

   }



   if ($spider_flag == false) {

     tep_session_start();

     $session_started = true;

   }

 } else {

   tep_session_start();

   $session_started = true;

 }

 

what can it be ?


Outside links in signatures are not allowed!

Share this post


Link to post
Share on other sites

Thanks for clarifying the page count. I guessed that already. As soon as the visitor logs in, the session changes but he keeps that session if he logs out again. Ah well, don't mind.

 

As my shop is not too busy right now and I'm a very curious observer, I added just a few more info to the page title. This is to get info if the visitor is clicking through a product listing as generated on a lot of pages (index.php for products in a category or for a manufacturer, advanced search results, what's new listing etc.). I also wanted to see which keywords they used when using the search function. I'm using other contribs too like allproducts listing (allprods.php).

 

Here is the code that I added to /catalog/includes/functions/leapfrog.php. Just find the first lines of the snippet and add the if statements following. If you have other pages in your shop where variables are passed via the URL, you can easily extend the mod to show even more info.

 

		} else {
		// Just use the page title
		$page_desc = tep_db_input(HEADING_TITLE);
		$page_thumb = "";
		}
		// The following modifications allow for more tracking info to be displayed
		// Add keywords if advanced search is used
		if(isset($HTTP_GET_VARS['keywords']) && $HTTP_GET_VARS['keywords'] != ''){
		$page_desc = $page_desc . ' (' . stripslashes($HTTP_GET_VARS['keywords']) . ')';
		}
		// Add character selected if allproducts contrib is used
		if(isset($HTTP_GET_VARS['fl']) && $HTTP_GET_VARS['fl'] != ''){
		$page_desc = $page_desc . ' (' . stripslashes($HTTP_GET_VARS['fl']) . ')';
		}
		// Add page number viewed when clicking through a listing
		if(isset($HTTP_GET_VARS['page']) && $HTTP_GET_VARS['page'] != ''){
		$page_desc = $page_desc . ' (page ' . stripslashes($HTTP_GET_VARS['page']) . ')';
		}

 

Come to think about this, there is no need to add the landing page in the leapfrog any more as my ads pass a variable in the URL too. I'll just add this in for my own entertainment.

 

abra


The First Law of E-Commerce: If the user can't find the product, the user can't buy the product.

 

Feedback and suggestions on my shop welcome.

 

Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.

Share this post


Link to post
Share on other sites

Some great suggestions there abra. Never knew that was how to find the search keywords.

 

The problem I am finding at the moment is the lack of screen space. In an ideal world I would show as much information as possible for each visitor, but when I do this the boxes get bigger and things start to look ugly. (I try and design things with lower screen resolutions in mind).

 

One option is to have another box that appears to the left of right of the ladder, when you click on a visitor. This would show more detailed info about that person. I will be looking into how well this method works.

Share this post


Link to post
Share on other sites

Well, I thought that too. Some things are much easier to do than one might think!

 

These modifications usually add just a little text to the right of page title where the title is pretty short anyway. So no space problem there. Only with the search keywords, that can get out of hand. People are typing in funny things...

 

I like the idea of having more info on a visitor opening in a separate box.

 

abra


The First Law of E-Commerce: If the user can't find the product, the user can't buy the product.

 

Feedback and suggestions on my shop welcome.

 

Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.

Share this post


Link to post
Share on other sites
Here is the code that I added to /catalog/includes/functions/leapfrog.php. Just find the first lines of the snippet and add the if statements following.

 

could you give more detail where to put this code ?

 

Suggestions : if we want the GUEST to be shown , at least it would be usefull to have GUEST 1 , GUEST 2 etc ...


MS2

Share this post


Link to post
Share on other sites

In catalog/includes/functions/leapfrog.php, replace lines 96 to 102 with the code above to show page number etc.

 

abra


The First Law of E-Commerce: If the user can't find the product, the user can't buy the product.

 

Feedback and suggestions on my shop welcome.

 

Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.

Share this post


Link to post
Share on other sites

Leapfrog V1.3 has been released!

 

It includes the following new features:

 

* IP lookup added

* Visitor real name displayed after they have logged out

* Added auto-purge feature that automatically clears Leapfrog tracking data from the database after a set period of time

* Bot/spider name displayed

* Guests given unique number to help identify them

 

Hope you like it :).

 

PS. If you are upgrading from a previous version, you MUST still run the SQL commands on your database.

Share this post


Link to post
Share on other sites
Leapfrog V1.3 has been released!

 

It includes the following new features:

 

* IP lookup added

* Visitor real name displayed after they have logged out

* Added auto-purge feature that automatically clears Leapfrog tracking data from the database after a set period of time

* Bot/spider name displayed

* Guests given unique number to help identify them

 

Hope you like it :).

 

PS. If you are upgrading from a previous version, you MUST still run the SQL commands on your database.

 

Hi Ed,

 

Just installe version 1.3

 

All fine except for the fact that I have google and inktomi recorded by leapfrog even though I've excluded robots in settings (IP 74.6.74.205 for ink and 66.249.65.46 for google )

 

any ideas why ?

 

Thanks

Franco


Outside links in signatures are not allowed!

Share this post


Link to post
Share on other sites
All fine except for the fact that I have google and inktomi recorded by leapfrog even though I've excluded robots in settings (IP 74.6.74.205 for ink and 66.249.65.46 for google )

 

any ideas why ?

 

Spider recognition is based on the code already found in MS2. The HTTP_USER_AGENT variable is checked against entries in the catalog/includs/spiders.txt file. If there is a match, then OSC knows it's a spider.

 

It is possible that google and inktomi have changed their HTTP_USER_AGENT ids, and are no longer picked up.

 

Can you look in your logs and see what the HTTP_USER_AGENT variable is for these two bots? They usually look something like:

 

Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)

 

Then add the name to spiders.txt. So in the above example you would add the line 'Yahoo! Slurp'.

 

Let me know if that works.

Share this post


Link to post
Share on other sites

I like leapfrog, but the new version has made it stopped working on my website. I have gone over all the instructions three times! >_<

 

It looks like nothing is being recorded in the database - and I have checked and reconfirmed the part in footer.php...

 

Site: www.ipodxtras.com

 

Any suggestions?

Share this post


Link to post
Share on other sites
I like leapfrog, but the new version has made it stopped working on my website. I have gone over all the instructions three times! >_<

 

It looks like nothing is being recorded in the database - and I have checked and reconfirmed the part in footer.php...

 

Site: www.ipodxtras.com

 

Any suggestions?

 

If anyone is having problems with data not being recorded in the database then here's a quick hack. BEAR IN MIND that changing this will mean that the 'Exclude Robots and Spiders' button in the settings window will not work. All visits will be tracked. But at least you will have a working Leapfrog.

 

Open catalog/includes/functions/leapfrog.php and find the following line (143):

 

if ( (LEAPFROG_EXCLUDE_ROBOTS == 'true' && $spider_flag != true) || LEAPFROG_EXCLUDE_ROBOTS == 'false') {

 

Change this to:

 

if (true) {

Share this post


Link to post
Share on other sites
Spider recognition is based on the code already found in MS2. The HTTP_USER_AGENT variable is checked against entries in the catalog/includs/spiders.txt file. If there is a match, then OSC knows it's a spider.

 

It is possible that google and inktomi have changed their HTTP_USER_AGENT ids, and are no longer picked up.

 

Can you look in your logs and see what the HTTP_USER_AGENT variable is for these two bots? They usually look something like:

 

Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)

 

Then add the name to spiders.txt. So in the above example you would add the line 'Yahoo! Slurp'.

 

Let me know if that works.

 

Hi,

 

well, for some reasons I can't access my logs right now, so I can't really check the user agent. I had a look at my spider.txt and found that either googlebot and slurp where already there. Do you think the names must be written the same way ? I mean capital letter like "Googlebot" or is googlebot the same thing ?

 

Since spiders were recorded despite I excluded them from settings I had to change functions/leapfrog.php to only write into DB the hits with a session ID assigned. The exclusion via settings wasn't working for me...

 

Thanks


Outside links in signatures are not allowed!

Share this post


Link to post
Share on other sites

I also noticed that leapfrog disconnects from DB quite often, saying that "...can't connect to DB". does anybody has the same problem ?

Edited by Tomcat

Outside links in signatures are not allowed!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×