Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2008
    Posts
    118
    Plugin Contributions
    0

    Default Sales tracking code...HELP!

    Hi, I'll pay someone ($20 Paypal) for help on this one...
    there are other ZenCart users who need this information as well.

    I'm currently trying to install the sale tracking code for my StuffedTracker(.com)...
    It's tricky business because the StuffedTracker guys don't know the ZenCart defines...
    and this problem relies heavily on ZenCart specific information.

    The main problem is getting the "product info" to display in the "sales tracking"...
    the code below is setup to handle this info, but I can't get it working...my lack of programming knowledge.

    Here's the supplied tracking code...
    "nsOrderItems.push" needs some sort of dynamic input from ZenCart:

    Code:
    <!-- Start of Stuffed Tracker 3.0.2 code for http://www.domain.com -->
    <script type="text/javascript">
    var nsAmp=unescape('%26');
    var nsSiteId=1;
    var nsTrackPath='https://www.domain.com/stracker/index.php?sc=track'+nsAmp+'action=sale'+nsAmp+'';
    var nsTrackMode='sale';
    var nsCode=1;
    var nsCost='';
    var nsOrderId='';
    var nsOrderInfo='';
    var nsOrderItems = new Array();
    //nsOrderItems.push('{{product}}{{10}}{{1}}');
    </script>
    <script type="text/javascript" src="https://www.domain.com/tracker/track.js"></script>
    <noscript>
    <p style="display:none"><img src="https://www.domain.com/tracker/index.php?sc=track&amp;action=sale&amp;st=1" width="1" height="1" alt="" style="display:none"/></p>
    </noscript>
    <!-- End of Stuffed Tracker code -->
    I've already tried using the defines from the ZenCart email system...
    but they don't seem to register in StuffedTracker, I imagine they aren't getting parsed. (Hehe, am I using the right lingo here?)

    Could someone please help get this setup?
    I know it's not very difficult, but I've tested everything I can think of with my limited programming knowledge.

    See this StuffedTracker thread for an interesting example, this will help you understand a bit more...
    forums.stuffedguys.com/index.php?showtopic=1071&st=0#entry5027

    Please help get this working properly...
    it's critical we track our sales with product Name, Amount, Price, OrderID

    I'll answer any questions and help in any way I can...let me know.

    Thanks!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Sales tracking code...HELP!

    Have you looked at any of the code used by Google Analytics which does essentially the same thing?
    Or the JROX JAM affiliate system, which also does similarly?
    The code from either of those could be a helpful starting point for your needs.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Feb 2008
    Posts
    118
    Plugin Contributions
    0

    Default Re: Sales tracking code...HELP!

    Quote Originally Posted by DrByte View Post
    Have you looked at any of the code used by Google Analytics which does essentially the same thing?
    Thanks for the good idea DrByte...
    but, holy crap...that code is way beyond me, it's huge!

    I don't know enough about the database to decipher what I need...
    but it does remind me of my past tracking experience with an 'eCommerceTemplates' cart (using StuffedTracker).

    I got help with that long ago and it was working properly...
    perhaps someone could take a look at the code below and fill in the ZenCart specific info...?

    It should be laid out quite obviously, but there's an added PHP script inserted that does something with the database...
    I just need someone who's familiar with ZenCart functions, database queries, etc.

    Code:
    <script type="text/javascript">
    var nsAmp=unescape('%26');
    var nsSiteId=1;
    var nsTrackPath='https://www.domain.com/tracker/index.php?sc=track'+nsAmp+'action=sale'+nsAmp+'';
    var nsTrackMode='sale';
    var nsCode=1;
    var nsCost='<?php print $ordTotal?>';
    var nsOrderId='<?php print $ordID?>';
    var nsOrderInfo='<?php print $ordName?>';
    var nsOrderItems = new Array();
    //nsOrderItems.push('{{product}}{{10}}{{1}}');
    <?php
    		$sSQL = "SELECT cartProdName,cartProdPrice,cartQuantity FROM cart INNER JOIN products ON cart.cartProdId=products.pID WHERE cartOrderID='" . mysql_escape_string($sorderid) . "'";
    		$result = mysql_query($sSQL) or print(mysql_error());
    		if(mysql_num_rows($result) > 0){
    			while($rs = mysql_fetch_assoc($result)){
    			?>
    				nsOrderItems.push('{{<?php print $rs["cartProdName"]; ?>}}{{<?php print $ordTotal ?>}}{{<?php print $rs["cartQuantity"]; ?>}}');
    			<?php
    			}
    		}
    		mysql_free_result($result);
    	?>
    </script>
    The $20 offer still stands...
    we really need to get this done, it's the last major issue stopping us from launching (I think ).

    I really wish I could love Google Analytics (and make my life easy with a mod)...
    but StuffedTracker simply provides a faster tool...plus my business data stays private.

    Anyway, help would be financially appreciated...
    but if not, can anyone suggest a ZenCart programmer that's capable of doing good work?

    I'm a web/graphic designer, but I could really use a programmer that's interested in contract work for custom mods,
    as well as any future problems we may run into. We're happy to pay for help.

    thx.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Sales tracking code...HELP!

    Your nsCost and nsOrderId can be extracted from the following values available on the tpl_checkout_success_default.php page:

    Code:
    $order_summary['order_number']
    $order_summary['order_subtotal']
    $order_summary['credits_applied']
    $order_summary['order_total']
    $order_summary['commissionable_order']
    $order_summary['commissionable_order_formatted']
    $order_summary['coupon_code']
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Google Adwords Conversion Tracking code help.
    By wondergirl in forum General Questions
    Replies: 39
    Last Post: 16 May 2012, 04:21 PM
  2. Sales tracking code for checkout success, please help!
    By boinkit in forum General Questions
    Replies: 0
    Last Post: 6 Mar 2008, 06:08 PM

Posting Permissions

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