homepage Welcome to WebmasterWorld Guest from 54.225.24.227
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Tracking button/image
adamnichols45




msg:1275774
 3:25 pm on Feb 8, 2006 (gmt 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?

 

coopster




msg:1275775
 6:20 pm on Feb 8, 2006 (gmt 0)

Sure. But put what in the database?

adamnichols45




msg:1275776
 5:02 pm on Feb 9, 2006 (gmt 0)

i want to track if the button is clicked and then

input

random id
time
product
price

does that help?

jatar_k




msg:1275777
 5:31 pm on Feb 9, 2006 (gmt 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

adamnichols45




msg:1275778
 5:55 pm on Feb 9, 2006 (gmt 0)

thanks for the reply but that means nothing to me!

vevs




msg:1275779
 6:31 pm on Feb 9, 2006 (gmt 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

jatar_k




msg:1275780
 6:31 pm on Feb 9, 2006 (gmt 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.

adamnichols45




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

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

:)

parorrey




msg:1275782
 5:07 pm on Feb 11, 2006 (gmt 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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved