Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!


Sponsored Content

 

 
 

Photo
- - - - -

Tracking A Click


  • Please log in to reply
9 replies to this topic

#1 robwatts

robwatts

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 308 posts
  • Location:London - Hertfordshire

Posted 23 December 2003 - 09:01 AM

Hi All

I have a button that when clicked opens up the users mail program via use of mailto: and allows them to send a link via an email.

I realise that there are some browser issues with using mailto; but am not overly concerened with this as for 99% of users it will work. ( I intend to implement a more concrete solution as and when time permits, but it'll do for now )

Anyhow, my problem is this, when a user clicks on < a href=mailto:etc etc>button here</a> I would like to know that they have done so, so I can greater evaluate its perceived use and take up.

It looks like Google tracks clicks via the use of this construct:

<a href=url onmousedown="return clk(1,this)">url</a> using the following javascript.
<script>
<!--

function clk(n,el)
{if(document.images)
{(new Image()).src="/url?sa=T&start="+n+"&url="+escape(el.href);
}return true;
}
//-->
</script>

I am assuming that this registers the click and sends them on their way.

I'd like to do something similar but without reloading the page or sending them on anywhere.

I thought about opening a new window and activating the necessaries from there using php and javascript eg open a window, pass the variables, register the click in a text file or DB, activate the mailto, close the window, but am not happy with such an approach as 1. it seems very cumbersome and 2. I'm hopeful that there's a simpler solution.

If anyone has any ideas I'd be obliged. :)

Cheers

#2 Haystack

Haystack

    HR 7

  • Active Members
  • PipPipPipPipPipPipPip
  • 1,980 posts
  • Location:Minneapolis, MN

Posted 23 December 2003 - 10:22 AM

Rob, unless you're looking for info specifically about how many click on the link vs. send an email, why not just set up a unique email address, then track the number of emails received through that address?

#3 robwatts

robwatts

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 308 posts
  • Location:London - Hertfordshire

Posted 23 December 2003 - 10:35 AM

Hi Ed

I should have elaborated.

Its a 'tell a friend' type thing... not an e-mail to the site owner.

I'm just trying to find a simple way to determine how many times that 'tell a friend' button is clicked.

:P

#4 Haystack

Haystack

    HR 7

  • Active Members
  • PipPipPipPipPipPipPip
  • 1,980 posts
  • Location:Minneapolis, MN

Posted 23 December 2003 - 10:42 AM

That is a bit trickier. I wouldn't know how to build on your approach, but this script logs the use of the tell a friend forms including emails and page referred:
http://bignosebird.c.../birdcast.shtml

#5 jbelle

jbelle

    HR 4

  • Active Members
  • PipPipPipPip
  • 206 posts

Posted 23 December 2003 - 10:43 AM

I realize you're not asking about using a web form, but if you did you would be able to bcc yourself on the emails (which is actual usage, not clicks, but anyway). This could be very useful, because depending on where you've got this, you could learn a lot from why users are recommending this site to a friend and what they're saying (learned this accidentally when creating a new form and forgot to take myself off the bcc; discovered people used it for all sorts of reasons).

But, with just the simple mailto:, you could make it a form button that processes a small script alerting you that the link has been clicked on and then opening a mailto command (but that sounds like more work than creating a form).

I'm sure you could do something similar to the above that's simpler with javascript (onClick email yourself?), but I'm not familiar enough with javascript to point you in the right direction.

#6 robwatts

robwatts

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 308 posts
  • Location:London - Hertfordshire

Posted 23 December 2003 - 10:48 AM

Cheers Ed

That may come in handy at a later date, I'll bookmark it as a possible :P

#7 robwatts

robwatts

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 308 posts
  • Location:London - Hertfordshire

Posted 23 December 2003 - 10:56 AM

Thanks Jbelle, I may use a form at a later date, but I guess I'm trying to evaluate whether its worth my time and energy, hence my looking for a quick solution now.

Edited by robwatts, 23 December 2003 - 12:00 PM.


#8 Scottie

Scottie

    Psycho Mom

  • Admin
  • 6,293 posts
  • Location:Columbia, SC

Posted 23 December 2003 - 10:59 AM

I realize you're not asking about using a web form, but if you did you would be able to bcc yourself on the emails (which is actual usage, not clicks, but anyway). 


If you are copying yourself on e-mail forms, you need to disclose this to the user.

#9 bobsledbob

bobsledbob

    HR 3

  • Active Members
  • PipPipPip
  • 102 posts
  • Location:Ogden, Utah, USA

Posted 23 December 2003 - 05:14 PM

Using a google-like tracker would probably do exactly what you're looking for.

You know how you can use javascript to load images in a browser? Typically, these images are 'preloaded' so that they can be used in a image rollover. However, what google is doing is loading an image that isn't used anywhere.

The javascript requests an image from Google's servers which would then log the image request just like any other image in your webserver's log file.

This would work real good for you. Create a 1x1 pixel and uniquely name it. Then, add the onmousedown event to your link to request the 1x1 pixel. It could be as simple as:

<a href="..." onmousedown="(new Image()).src = '/path/to/your/image';">

Then, just look for this image being requested in your log file to find out how many times the feature has been used. It's a pretty clever technique. Using the onmousedown event is better than onclick because it gets triggered before the 'click' does.

#10 robwatts

robwatts

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 308 posts
  • Location:London - Hertfordshire

Posted 23 December 2003 - 06:46 PM

ah..becomes all the clearer to me now.

Thanks Adam just the kind of prompt I was after :cheers:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users