Track Sales From Affiliates

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fritz Bayer

    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
  • Grant Wagner

    #2
    Re: Track Sales From Affiliates

    "Fritz Bayer" <fritz-bayer@web.de> wrote in message
    news:a9c0aa9e.0 505250726.72e6c ba7@posting.goo gle.com...[color=blue]
    > 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[/color]

    <script type="text/javascript">
    function sendData(valueO fA, 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.eleme nts['a'].value,
    this.form.eleme nts['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 <gwagner@agrico reunited.com>
    comp.lang.javas cript FAQ - http://jibbering.com/faq


    Comment

    • Fritz Bayer

      #3
      Re: Track Sales From Affiliates

      "Grant Wagner" <gwagner@agrico reunited.com> wrote in message news:<Sa1le.343 $3d3.1766@news2 .mts.net>...[color=blue]
      > "Fritz Bayer" <fritz-bayer@web.de> wrote in message
      > news:a9c0aa9e.0 505250726.72e6c ba7@posting.goo gle.com...[color=green]
      > > 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[/color]
      >
      > <script type="text/javascript">
      > function sendData(valueO fA, 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.eleme nts['a'].value,
      > this.form.eleme nts['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 />[/color]

      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="javas cript" type="text/javascript">
      <!--
      var google_conversi on_id = 0;
      var google_conversi on_language = "en_GB";
      var google_conversi on_format = "1";
      var google_conversi on_color = "FFFFFF";
      if ([VALUE]) {
      var google_conversi on_value = [VALUE];
      }
      var google_conversi on_label = "Purchase";
      //-->
      </script>
      <script language="javas cript"
      src="https://www.googleadser vices.com/pagead/conversion.js">
      </script>
      <noscript>
      <img height=1 width=1 border=0
      src="https://www.googleadser vices.com/pagead/conversion/0/?value=[VALUE]&label=Purchase &script=0">
      </noscript>

      <!-- Another script from a affiliate site -->
      <SCRIPT LANGUAGE="JavaS cript" TYPE="text/javascript">
      <!--
      document.write( "<SCR"+"IPT language=\"Java script\"
      type=\"text/javascript\"" +
      "SRC=\"http ://YourDomain/InstallationPat h/ad.pl?md=rt&z=2 &ca=7&typ=V&url =&ref="
      +
      escape(document .referrer) +
      "\"></SCR"+"IPT>") ;
      //-->
      </script>
      <NOSCRIPT><IM G WIDTH=1 HEIGHT=1
      SRC="http://YourDomain/InstallationPat h/ad.pl?md=rt&z=2 &ca=7&typ=V" ></noscript>

      Comment

      Working...