473,394 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Track Sales From Affiliates

Hello,

I'm looking for a javascript or html construct, which allows me to
pass some sales data to a remote cgi script. It should work for http
and https (ssl) connections.

The script or html construct should be in such a way that it does not
have any affect on the layout of the html page in which it is
embedded.

Fritz
Jul 23 '05 #1
2 1188
"Fritz Bayer" <fr*********@web.de> wrote in message
news:a9**************************@posting.google.c om...
Hello,

I'm looking for a javascript or html construct, which allows me to
pass some sales data to a remote cgi script. It should work for http
and https (ssl) connections.

The script or html construct should be in such a way that it does not
have any affect on the layout of the html page in which it is
embedded.

Fritz


<script type="text/javascript">
function sendData(valueOfA, valueOfB)
{
(new Image()).src =
'yourCgiScript.cgi' +
'?a=' + valueOfA +
'&b=' + valueOfB;
}
</script>
<form>
<input type="text" name="a" value="abc">
<input type="text" name="b" value="def">
<input type="button"
value="Send Data"
onclick="
sendData(
this.form.elements['a'].value,
this.form.elements['b'].value
);
">

Split across lines to avoid wordwrap.

Using (new Image()).src depends on the user agent supporting client-side
JavaScript and having it enabled, and supporting the ability to create a
new Image object and successfully set it's -src- property which results
in a GET to the server.

Getting data back to the client using this method, while possible, it
complicated and cumbersome. If you need the user agent to know the
results of the transaction, you should use the XML HTTP object <url:
http://jibbering.com/2002/4/httprequest.html />

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #2
"Grant Wagner" <gw*****@agricoreunited.com> wrote in message news:<Sa****************@news2.mts.net>...
"Fritz Bayer" <fr*********@web.de> wrote in message
news:a9**************************@posting.google.c om...
Hello,

I'm looking for a javascript or html construct, which allows me to
pass some sales data to a remote cgi script. It should work for http
and https (ssl) connections.

The script or html construct should be in such a way that it does not
have any affect on the layout of the html page in which it is
embedded.

Fritz


<script type="text/javascript">
function sendData(valueOfA, valueOfB)
{
(new Image()).src =
'yourCgiScript.cgi' +
'?a=' + valueOfA +
'&b=' + valueOfB;
}
</script>
<form>
<input type="text" name="a" value="abc">
<input type="text" name="b" value="def">
<input type="button"
value="Send Data"
onclick="
sendData(
this.form.elements['a'].value,
this.form.elements['b'].value
);
">

Split across lines to avoid wordwrap.

Using (new Image()).src depends on the user agent supporting client-side
JavaScript and having it enabled, and supporting the ability to create a
new Image object and successfully set it's -src- property which results
in a GET to the server.

Getting data back to the client using this method, while possible, it
complicated and cumbersome. If you need the user agent to know the
results of the transaction, you should use the XML HTTP object <url:
http://jibbering.com/2002/4/httprequest.html />


Thanks for the code snippet. Yesterday I googled a bit more and found
the following two code snippets. What do you think of those?

<!-- Google Code for Purchase Conversion Page -->
<script language="javascript" type="text/javascript">
<!--
var google_conversion_id = 0;
var google_conversion_language = "en_GB";
var google_conversion_format = "1";
var google_conversion_color = "FFFFFF";
if ([VALUE]) {
var google_conversion_value = [VALUE];
}
var google_conversion_label = "Purchase";
//-->
</script>
<script language="javascript"
src="https://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<img height=1 width=1 border=0
src="https://www.googleadservices.com/pagead/conversion/0/?value=[VALUE]&label=Purchase&script=0">
</noscript>

<!-- Another script from a affiliate site -->
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
document.write("<SCR"+"IPT language=\"Javascript\"
type=\"text/javascript\"" +
"SRC=\"http://YourDomain/InstallationPath/ad.pl?md=rt&z=2&ca=7&typ=V&url=&ref="
+
escape(document.referrer) +
"\"></SCR"+"IPT>") ;
//-->
</script>
<NOSCRIPT><IMG WIDTH=1 HEIGHT=1
SRC="http://YourDomain/InstallationPath/ad.pl?md=rt&z=2&ca=7&typ=V"></noscript>
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: | last post by:
(subject included - apologies) <jason@catamaranco.com> wrote in message news:... > Is there a simple way to track users leaving our site to vendors whose wares > we have advertised as a banner...
4
by: RT | last post by:
I would like to start offering an "Affiliate" program on my website. Can anyone offer a script that I can use to track clicking to my site from an affiliate's link?
1
by: Terencetrent | last post by:
I have created a query that examines qarterly sales for 5 regions in the country. The query contains data for the past 6 quarters for each region and calculates the perecentage of total sales for...
3
by: johnny | last post by:
hi all! I am starting to study the best way to track site visitors. Logfiles stats which come with every web hosting, have little metrics to be analyzed and also problems with cached pages which...
5
by: Wired Hosting News | last post by:
I tried to be breif and give a scenario so as not to be overlooked because it was soooo long. Let me give you real world. I am a manufacturer of goods and produce 11 items that are distributed...
2
by: kansaskannan | last post by:
I have an Access 2000 database which lists customers by name, and how much (in dollars) they have purchased of various products. How do I write a SQL statement to select customers who make up the...
2
by: ship | last post by:
Microsoft IIS (latest) asp.net 2.0 Hi How can we track (numerous) separate marketing campaigns using IIS and asp.net (2.0)? (We are trying hard to AVOID having to set up a new directory...
0
by: nrcjersey | last post by:
We have a small online business going, and I have launched an affiliate program, but I'm not sure how effective it's been. Mainly because few affiliates are interested in my "pay-per-signup"...
4
by: wutang | last post by:
Create a program that displays the sum of the sales amounts made in each of four regions (North, South, East, West) during a three month period. The program should display the total sales made during...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.