Welcome to WebmasterWorld Guest from 188.8.131.52 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Pubcon Platinum Sponsor 2014
Tracking button/image adamnichols45
is it easy to use php to track if some one clicks on of my images/buttons and them put this in a database?
Sure. But put what in the database? adamnichols45
i want to track if the button is clicked and then
time product price
does that help?
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 adamnichols45
thanks for the reply but that means nothing to me! vevs
for the button/image you should use a link like this:
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
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.
excellent thanks for the great feedback i will look in to these options.
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