Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Aug 2009
    Posts
    31
    Plugin Contributions
    0

    Default How to Integrate ShareASale tracking code?

    I'm using ZenCart 1.3.8a and am using PayPal Website Payments Standard for all transactions. It is set up so that the customer returns to my site, to a Thank You page, after payment on PayPal has been made. I'm trying to implement ShareASale affiliate tracking code, but am at a loss.

    The ShareASale site provides this info for integration:

    Tracking Code details for PayPal Website Payments Standard

    Unfortunately, integrating with PayPal Website Payments Standard is more difficult than most shopping carts. You will need to setup their Payment Data Transfer system before integrating with ShareASale. See PayPal's documentation and sample code here:

    https://www.paypal.com/cgi-bin/websc...-intro-outside

    Unfortunately, ShareASale is unable to help in setting up the Payment Data Transfer system. If you require assistance you should contact PayPal directly.

    Once you have the Payment Data Transfer system running, you can use the following tracking codes in your Auto-Return script:

    ASP
    Response.Write("<img src=""https://shareasale.com/sale.cfm?amount=" & mcGross & "&tracking=" & txToken & "&transtype=SALE&merchantID=XXXX"" width=""1"" height=""1"">")

    PHP
    echo ("<img src=\"https://shareasale.com/sale.cfm?amount=$amount&tracking=$tx_token&transtype=SALE&merchantID =XXXX\" width=\"1\" height=\"1\">");

    Where you replace XXXX with your ShareASale merchant ID number.


    For how to install with ZenCart, they provide this:

    Tracking Code details for ZenCart for ZenCart version 1.3.8 and higher:

    You will be marking changes to the following file:

    /includes/templates/DEFAULT/checkout_success/tpl_footer.php

    Where DEFAULT is the name of the current template group that you are using. If the checkout_success folder does not exist, you can create it. If the tpl_footer.php file does not exist, you can create it. Add the following code to the tpl_footer.php page:

    <font face="trebuchet ms, verdana" point-size="10" size="-1">&lt;?php if (isset($zv_orders_id) &amp;&amp; (int)$zv_orders_id &gt; 0 &amp;&amp; isset($order_summary) &amp;&amp; is_array($order_summary)) { if (!isset($_SESSION['affiliate_order_id']) || $_SESSION['affiliate_order_id'] != $zv_orders_id ) { $_SESSION['affiliate_order_id'] = $zv_orders_id; $commissionable_order_formatted = number_format($order_summary['commissionable_order'], 2, '.', ''); echo '&lt;img src="https://shareasale.com/sale.cfm?amount=' . $commissionable_order_formatted . '&amp;tracking=' . $order_summary['order_number'] . '&amp;transtype=sale&amp;merchantID=XXXX" width="1" height="1"&gt;'; } } ?&gt;

    Where you replace XXXX with your merchant ID number. </font>

    I have tried placing both versions of code in my tpl_footer.php file which is located in a checkout_success folder. I have tested both, but neither test is being recognized by ShareASale.

    Do I need to add any other code to the tpl_footer.php or any other file? If so, can someone direct me on what to do?

    my site is: www.pennylanepapersgiftbags.com

    thanks so much!

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

    Default Re: How to Integrate ShareASale tracking code?

    The instructions they've given for Zen Cart sites are correct.
    Maybe you've not put it in the right folder/file path?

    Test it: when you get to the checkout-success page, look at the raw HTML in your browser. Is the code they told you to add showing up there? If not, you've put the code in the wrong place. If it *is* present, inspect the numbers/values in it, and see whether you're getting valid order numbers and amounts. If not, you've got other customizations conflicting. If yes, then something's wrong on the shareasale end.
    .

    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
    Aug 2009
    Posts
    31
    Plugin Contributions
    0

    Default Re: How to Integrate ShareASale tracking code?

    Thanks!

    I tried again, and when I add the code for Zen Cart, the page source shows this (which is nothing):

    <!--ShareASale tracking code -->

    <!--End ShareASale tracking code -->

    When I use the code for PayPal Website Payments Standard, the page source shows this (the X's after merchantID is my merchant number which shows properly; I removed it for this post):

    <!--ShareASale tracking code -->

    echo
    ("&lt;img
    src=\"https://shareasale.com/sale.cfm?amount=$amount&amp;tracking=$tx_token&amp;transtype=SALE&amp;merchantID =XXXXX\"
    width=\"1\" height=\"1\"&gt;");


    <!--End ShareASale tracking code -->

    Nothing is registering on the ShareASale end.

    Any thoughts as to what I need to do? Appreciate your help!

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

    Default Re: How to Integrate ShareASale tracking code?

    Quote Originally Posted by pennylane View Post
    I tried again, and when I add the code for Zen Cart, the page source shows this (which is nothing):

    <!--ShareASale tracking code -->

    <!--End ShareASale tracking code -->
    That doesn't make sense at all ... because if you've added the <!-- ShareASale ... stuff to the tpl_footer file (you'd have to, since Zen Cart doesn't know about it otherwise) then you should *also* be seeing the <font ... stuff you also added.
    Quote Originally Posted by pennylane View Post
    When I use the code for PayPal Website Payments Standard, the page source shows this (the X's after merchantID is my merchant number which shows properly; I removed it for this post):

    <!--ShareASale tracking code -->

    echo
    ("&lt;img
    src=\"https://shareasale.com/sale.cfm?amount=$amount&amp;tracking=$tx_token&amp;transtype=SALE&amp;merchantID =XXXXX\"
    width=\"1\" height=\"1\"&gt;");


    <!--End ShareASale tracking code -->
    That code is intended for sites that don't have an advanced automated interaction with PayPal like Zen Cart does.
    You should be ignoring the PayPal-specific instructions they've given you unless you're using something other than Zen Cart.
    .

    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.

  5. #5
    Join Date
    Aug 2009
    Posts
    31
    Plugin Contributions
    0

    Default Re: How to Integrate ShareASale tracking code?

    thanks. I'll try adding the code specific to Zen Cart again, maybe i missed something.

  6. #6
    Join Date
    Aug 2009
    Posts
    31
    Plugin Contributions
    0

    Default Re: How to Integrate ShareASale tracking code?

    well i tried the PayPal code again, and it still doesn't show in the page source and it's not being recognized by ShareASale. Do I need to define any of items in the ShareASale code string in ZenCart? And if so, how/where would I do that?

    again, this is the code I've added to the tpl_footer.php file (I've replaced my merchant code with X's in this post):

    <?php if (isset($zv_orders_id) && (int)$zv_orders_id > 0 && isset($order_summary) && is_array($order_summary)) { if (!isset($_SESSION['affiliate_order_id']) || $_SESSION['affiliate_order_id'] != $zv_orders_id ) { $_SESSION['affiliate_order_id'] = $zv_orders_id; $commissionable_order_formatted = number_format($order_summary['commissionable_order'], 2, '.', ''); echo '<img src="https://shareasale.com/sale.cfm?amount=' . $commissionable_order_formatted . '&tracking=' . $order_summary['order_number'] . '&transtype=sale&merchantID=XXXXX" width="1" height="1">'; } } ?>

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

    Default Re: How to Integrate ShareASale tracking code?

    Add "ABCDEFG" directly above that, in the file you edited.
    Then checkout to the success page.
    Does the ABCDEFG text show on the page?
    If not, then you've got all the code in the wrong file/folder.
    .

    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.

  8. #8
    Join Date
    Aug 2009
    Posts
    31
    Plugin Contributions
    0

    Default Re: How to Integrate ShareASale tracking code?

    I put it in in two places . both show, so the tracking code is in the correct file. any other thoughts?

    ABCDEFG
    <!--ShareASale tracking code -->
    ABCDEFG

    <!--End ShareASale tracking code -->

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

    Default Re: How to Integrate ShareASale tracking code?

    What version of Zen Cart?
    What's in your /includes/modules/pages/checkout_success/header_php.php file?
    And, please post your full customized tpl_footer.php file that you've been editing.
    I'm guessing that the various "if" statements are causing the failure ... ie: the order id and order summary don't exist ... presumably because of some customization you've got on your site, or outdated versions of core files.
    .

    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.

  10. #10
    Join Date
    Aug 2009
    Posts
    31
    Plugin Contributions
    0

    Default Re: How to Integrate ShareASale tracking code?

    Thanks for responding so quickly!!

    I'm using ZenCart 1.3.8a

    here's the code:

    <?php
    /**
    * Common Template - tpl_footer.php
    *
    * this file can be copied to /templates/your_template_dir/pagename<br />
    * example: to override the privacy page<br />
    * make a directory /templates/my_template/privacy<br />
    * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_footer.php<br />
    * to override the global settings and turn off the footer un-comment the following line:<br />
    * <br />
    * $flag_disable_footer = true;<br />
    *
    * @package templateSystem
    * @copyright Copyright 2003-2005 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: tpl_footer.php 4821 2006-10-23 10:54:15Z drbyte $
    */
    require(DIR_WS_MODULES . zen_get_module_directory('footer.php'));
    ?>




    <?php
    if (!isset($flag_disable_footer) || !$flag_disable_footer) {
    ?>

    <!--bof-navigation display -->
    <div id="navSuppWrapper">
    <div id="navSupp">
    <ul>
    <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
    <?php if (EZPAGES_STATUS_FOOTER == '1' or (EZPAGES_STATUS_FOOTER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
    <li><?php require($template->get_template_dir('tpl_ezpages_bar_footer.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_footer.php'); ?></li>
    <?php } ?>
    </ul>
    </div>
    </div>
    <!--eof-navigation display -->

    <!--bof-ip address display -->
    <?php
    if (SHOW_FOOTER_IP == '1') {
    ?>
    <div id="siteinfoIP"><?php echo TEXT_YOUR_IP_ADDRESS . ' ' . $_SERVER['REMOTE_ADDR']; ?></div>
    <?php
    }
    ?>
    <!--eof-ip address display -->

    <!--bof-banner #5 display -->
    <?php
    if (SHOW_BANNERS_GROUP_SET5 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET5)) {
    if ($banner->RecordCount() > 0) {
    ?>
    <div id="bannerFive" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
    <?php
    }
    }
    ?>
    <!--eof-banner #5 display -->

    <!--bof- site copyright display -->
    <div id="siteinfoLegal" class="legalCopyright"><?php echo FOOTER_TEXT_BODY; ?>
    <?php if ($_GET['main_page'] == 'checkout_shipping' || $_GET['main_page'] == 'checkout') { ?>
    <br />
    <center>FedEx service marks used by permission.</center>
    <?php } ?>
    </div>
    <!--eof- site copyright display -->

    <?php
    } // flag_disable_footer
    ?>

    ABCDEFG
    <!--ShareASale tracking code -->
    ABCDEFG
    <?php if (isset($zv_orders_id) && (int)$zv_orders_id > 0 && isset($order_summary) && is_array($order_summary)) { if (!isset($_SESSION['affiliate_order_id']) || $_SESSION['affiliate_order_id'] != $zv_orders_id ) { $_SESSION['affiliate_order_id'] = $zv_orders_id; $commissionable_order_formatted = number_format($order_summary['commissionable_order'], 2, '.', ''); echo '<img src="https://shareasale.com/sale.cfm?amount=' . $commissionable_order_formatted . '&tracking=' . $order_summary['order_number'] . '&transtype=sale&merchantID=XXXX" width="1" height="1">'; } } ?>

    <!--End ShareASale tracking code -->

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 22
    Last Post: 20 Sep 2021, 02:38 AM
  2. How/Where do I install Conversion Tracking Code
    By boy1da in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 15 Mar 2011, 04:33 PM
  3. Replies: 5
    Last Post: 27 May 2009, 07:50 PM
  4. How do I put a Google tracking code in my checkout-success file?
    By kevinmc3 in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 25 Jul 2008, 07:52 PM
  5. Integrate payment gateway code
    By sunny747 in forum Addon Payment Modules
    Replies: 1
    Last Post: 16 Mar 2007, 08:07 AM

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