Welcome to WebmasterWorld Guest from 54.196.231.129

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Tracking button/image

     
3:25 pm on Feb 8, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 16, 2004
posts:946
votes: 0


is it easy to use php to track if some one clicks on of my images/buttons and them put this in a database?
6:20 pm on Feb 8, 2006 (gmt 0)

Administrator

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
posts:12533
votes: 0


Sure. But put what in the database?
5:02 pm on Feb 9, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 16, 2004
posts:946
votes: 0


i want to track if the button is clicked and then

input

random id
time
product
price

does that help?

5:31 pm on Feb 9, 2006 (gmt 0)

Administrator

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
posts:15755
votes: 0


every link would have to go through a script then, might devalue internal links as they would all go to the same script except with a different id
5:55 pm on Feb 9, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 16, 2004
posts:946
votes: 0


thanks for the reply but that means nothing to me!
6:31 pm on Feb 9, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:July 12, 2005
posts:46
votes: 0


for the button/image you should use a link like this:

track.php?productId=1
where productId=1 changes for each of your products (productId=2, productId=3, .....)

$randid = rand(0,100000); - generates rand number from 0 to 100000
using the productId you can query your products DB and get the product's price and store in variable $productPrice

Using such a query you can add all the data in your track DB
INSERT INTO track_table ('$randid', now(), '$productId', '$productPrice')

so if someone clicks on track.php?productId=1 it will write in your DB the ID=1, product price, current time and random ID

6:31 pm on Feb 9, 2006 (gmt 0)

Administrator

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
posts:15755
votes: 0


well,

if you want to track every click you will need every link to go through a script that can insert the info into the db before you send them off to the desired page.

every link on your site will then go to this tracking script

have you looked into a log analyzer, maybe clicktracks, as that is probably a better option.

12:25 pm on Feb 11, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 16, 2004
posts:946
votes: 0


excellent thanks for the great feedback i will look in to these options.

:)

5:07 pm on Feb 11, 2006 (gmt 0)

New User

10+ Year Member

joined:July 20, 2005
posts:28
votes: 0


this way you may be able to track all clicks,
but be careful, its not that much bright idea if you consider SEO of the site.
giving all internal links the same page and that too not using the proper keywords will decrease its chances by a great deal.
-A