TJMAudio Posted November 12, 2007 Share Posted November 12, 2007 I am making a web-based game, and as an incentive to clicking ads I have a script to give people some extra starter cash. The only problem is, I don't know how to track people who clicked and submitted the advertisements. Basically, the only advertisement I am running right now is one where they must go in, register, and be approved. Could anyone (I don't expect people to hold my hand through it) give me some functions that would be useful, or a link to a tutorial, or just a quick snippet of sample code? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/76975-tracking-ad-clicks/ Share on other sites More sharing options...
nuxy Posted November 12, 2007 Share Posted November 12, 2007 Well, I'm sure you could edit an script to do this, you can find such scripts here. You can keep track of users by logging their IP, and also placing an cookie in their browser. Although both methods can be fooled, it's some of the best I can recommend. You could have an table for the clicks, with id's to identify to which advertisement they are made to. You can then make it time based, and add a time field to the table, and then working with that you can work out when they clicked and if they are allowed to click again. I don't know if the following will work for you, because this is a feature before signup. You could have them create an quick account, and then log it with account id's/names instead of depending on an IP or Cookie. Quote Link to comment https://forums.phpfreaks.com/topic/76975-tracking-ad-clicks/#findComment-389807 Share on other sites More sharing options...
TJMAudio Posted November 12, 2007 Author Share Posted November 12, 2007 They will be able to click the advertisement after their initial account activation, so they will be signed up for the site already. Basically, I just want to make it so when the advertisement is completed and clears, the extra game money is credited to their account. Quote Link to comment https://forums.phpfreaks.com/topic/76975-tracking-ad-clicks/#findComment-390107 Share on other sites More sharing options...
TJMAudio Posted November 13, 2007 Author Share Posted November 13, 2007 Is this even PHP? Or would it be JS? I can normally do pretty well figuring things out in terms of scripting, but this has me completely stumped. Quote Link to comment https://forums.phpfreaks.com/topic/76975-tracking-ad-clicks/#findComment-390342 Share on other sites More sharing options...
nuxy Posted November 13, 2007 Share Posted November 13, 2007 No, javascript won't completely do the job here. You should use a database, as I suggested before. Making an table to log the ad clicks, and checking the time and number of clicks. Quote Link to comment https://forums.phpfreaks.com/topic/76975-tracking-ad-clicks/#findComment-390476 Share on other sites More sharing options...
TJMAudio Posted May 18, 2008 Author Share Posted May 18, 2008 No, javascript won't completely do the job here. You should use a database, as I suggested before. Making an table to log the ad clicks, and checking the time and number of clicks. Hey, I am still completely lost when it comes to this. So I would use a table, which would be set up with fields like so: | clickID (which would be auto_inc) | UserID (user who clicked it) | IP Address | AdLink | Date/Time | The thing I am confused about is how I would automatically credit their account for clicking and actually FILLING OUT the advertisement. I am scripting an online game and filling out ads (example, registering and bidding on an item on ebay), would give them extra starting money/items as a 'perk'. So, the problem I am coming across is how I would do this; the whole checking if they did it, then automatically crediting the UserID when it has processed. Normally I would come here for more exact help, but to be honest I have no idea where to even start, so even advice there would be great. Quote Link to comment https://forums.phpfreaks.com/topic/76975-tracking-ad-clicks/#findComment-544024 Share on other sites More sharing options...
micmania1 Posted May 18, 2008 Share Posted May 18, 2008 If you have acess to the URL, you could take it to another page first. http://domain.com/clicked_ad.php?url={URL} From that, i'm guessing you will be able to determind user details from their session or cookie, and save it into the db. +-------------+-------------+ | User ID | URL | +-------------+-------------+ | 1 | http://.... | +-------------+-------------+ Quote Link to comment https://forums.phpfreaks.com/topic/76975-tracking-ad-clicks/#findComment-544070 Share on other sites More sharing options...
scarhand Posted May 18, 2008 Share Posted May 18, 2008 I am making a web-based game, and as an incentive to clicking ads I have a script to give people some extra starter cash. The only problem is, I don't know how to track people who clicked and submitted the advertisements. Basically, the only advertisement I am running right now is one where they must go in, register, and be approved. Could anyone (I don't expect people to hold my hand through it) give me some functions that would be useful, or a link to a tutorial, or just a quick snippet of sample code? Thanks! use a simple mysql table like the one micmania posted Quote Link to comment https://forums.phpfreaks.com/topic/76975-tracking-ad-clicks/#findComment-544179 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.