Hit script
Moderator: General Moderators
Hit script
I am trying to make a script that a user signs up for an affiliate scheme. Once signed up, (s)he gets a unique number. Then, I am using this number to collect the impressions (s)he gets (hits), and also the clicks (click through rate) the link recieves. I can collect the clicks easily, there is no problem there, but is there a way in which I can make the hits increment.
Obviously I dont want to give them a PHP script with connect etc, and also the usernames and passwords. Although this information could be encypted (still a risk of them brute forcing it) but also, people who sign up for the affiliate scheme may not have PHP enabled on their server.
So, can anyone think of a way in which every impression the image/link gets, the database will increment accordingly. I suppose this is kind of like the Google Adsense way, in which you give them a code etc.
Thanks.
Obviously I dont want to give them a PHP script with connect etc, and also the usernames and passwords. Although this information could be encypted (still a risk of them brute forcing it) but also, people who sign up for the affiliate scheme may not have PHP enabled on their server.
So, can anyone think of a way in which every impression the image/link gets, the database will increment accordingly. I suppose this is kind of like the Google Adsense way, in which you give them a code etc.
Thanks.
-
ldomingues
- Forum Commoner
- Posts: 41
- Joined: Fri Aug 06, 2004 1:15 pm
- Location: Portugal
You can have a script in your server which collects clicks.
For instance: You give to your affiliate a link like: http://www.yourserver.com/click.php?affiliate=100
When a use clicks on the affiliate site, he gets redirected to http://www.yourserver.com/click.php?affiliate=100, and you put that in a DB/file, etc.
For instance: You give to your affiliate a link like: http://www.yourserver.com/click.php?affiliate=100
When a use clicks on the affiliate site, he gets redirected to http://www.yourserver.com/click.php?affiliate=100, and you put that in a DB/file, etc.
-
ldomingues
- Forum Commoner
- Posts: 41
- Joined: Fri Aug 06, 2004 1:15 pm
- Location: Portugal
-
ldomingues
- Forum Commoner
- Posts: 41
- Joined: Fri Aug 06, 2004 1:15 pm
- Location: Portugal
It's more clear now... You want to track link impressions, not link clicks.
Option 1) use a ad server application - phpaddsnew works greate
Option 2) if the customer has php support (or any other language), he has to include a php script (hosted on your server) which in turn will generate the link and count the impression
Option 3) no php support - use javascript which is returned by a php script on your server
Example:
Your server has generatelink.php - which returns:
<script>
document.write("yourlink");
</script>
To include a link the user includes one or more javascript files (which are in reality php scripts which return javascript).
Look in detail phpaddsnew - it does something like this.
Option 1) use a ad server application - phpaddsnew works greate
Option 2) if the customer has php support (or any other language), he has to include a php script (hosted on your server) which in turn will generate the link and count the impression
Option 3) no php support - use javascript which is returned by a php script on your server
Example:
Your server has generatelink.php - which returns:
<script>
document.write("yourlink");
</script>
To include a link the user includes one or more javascript files (which are in reality php scripts which return javascript).
Look in detail phpaddsnew - it does something like this.
-
ldomingues
- Forum Commoner
- Posts: 41
- Joined: Fri Aug 06, 2004 1:15 pm
- Location: Portugal
-
ldomingues
- Forum Commoner
- Posts: 41
- Joined: Fri Aug 06, 2004 1:15 pm
- Location: Portugal
-
ldomingues
- Forum Commoner
- Posts: 41
- Joined: Fri Aug 06, 2004 1:15 pm
- Location: Portugal
feyd | Please use
feyd | Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Here is the generated JavaScript code to output one banner:Code: Select all
<script language='JavaScript' type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
document.write ("http://adserver/adserver/adjs.php?n=" + phpAds_random);
document.write ("&what=zone:1&target=_blank&blockcampaign=1");
document.write ("&exclude=" + document.phpAds_used);
if (document.referer)
document.write ("&referer=" + escape(document.referer));
document.write ("'><" + "/script>");
//-->
</script>feyd | Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]