SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: data capturing

  1. #1
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    data capturing

    Does anyone know of any good articles/tutorials on using JavaScript to capture data (like how affiliate programs capture the data on the sales)?

  2. #2
    SitePoint Guru alecrust's Avatar
    Join Date
    Jun 2007
    Location
    London, UK
    Posts
    728
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're not describing your question well enough.

    JavaScript can capture many sorts of data. here for example is how to capture the current date.
    Honda Civic Forum - UK Civic Forum
    Web Host Reviews - Independent, honest host reviews
    My Portfolio - Simplicity is the ultimate sophistication

  3. #3
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sorry if that wasn't clear enough, but I'd like to capture sales information (items ordered, price of each item, total order sale, etc.) from our affiliates. The webmasters would insert a little bit of JS on their order confirmation page which would be populated with the sales info.

    For example, here's an example of how shopzilla does it.

    HTML Code:
    <script language="javascript">
    <!--
    	/* ROI Tracking Data */
    	var order_value    = '$50.00';
    	var order_id       = '12345';
    	var units_ordered  = '3';
    //-->
    </script>
    <script language="javascript" src="https://www.shopzilla.com/css/roi_tracker.js"></script>
    The part I'm unclear on is the actual script that will process the data and send it to our server (the roi_tracker.js) script. Can anyone provide any info on a simple, secure method of processing the data sent via JS and adding it to our server? I'm just unclear on the JS part of it.

  4. #4
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can anyone offer any insight on sending/processing the data with JavaScript?

    At the most basic level of thought, would you just take the JavaScript variables they set and make a GET request with the variables and then obviously handle all the data sanitizing and security on the server?

  5. #5
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure if I'm searching for the wrong thing or what, but I can't find any information on this subject anywhere.

    Does anyone at least know what I'm talking about or am I using the wrong terminology when explaining/searching this?

  6. #6
    SitePoint Evangelist
    Join Date
    Apr 2008
    Location
    Dublin, Ireland
    Posts
    461
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Presumably the idea here is the script will be on your server to avoid the need for cross domain ajax. So if you have a template form on your site and you develop an ajax script (in an external .js file) to take data entered on this form and save it wherever you wish (db I imagine) then assuming your affiliates use the exact same form template they can add a link to your script file that should work in the same way.

    I am guessing here because I don't know if this works or if it would be considered cross-domain anyway. The other option is the affiliate installs the backend part too and the backend can send the data to you using web services.

    In essence what you are looking for is cross domain ajax workarounds and there are a few if you google it.

  7. #7
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Brian. Thank you for your reply.

    The data that the script would be automatically sending to our server wouldn't be sent by a form so is it really necessary to use AJAX for this?

    The affiliate's programmer would drop the small piece of JavaScript code on a page that the user is redirected to AFTER the user makes a purchase. The affiliate's programmer would also set the various JavaScript variables (which includes the sales information) within the code that they drop onto the page.
    When the page loads, it should automatically send the data to our server behind the scene. The user just sees the normal "thank you" or "order confirmation" page.

  8. #8
    SitePoint Evangelist
    Join Date
    Apr 2008
    Location
    Dublin, Ireland
    Posts
    461
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think what you will need to do is talk to the affiliate about it. I'm not 100% clear on what you want to do. If your site processes the sale you could record your own data from that before sending it to the affiliate. Once the user is redirected to the affiliate it's out of your hands unless they provide you with a way. Again I'm not clear on what you want to do.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •