Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 7 of 7

Thread: Integrating 3rd Party Affiliate Tracking Software

  1. #1
    bpo is offline Junior Member
    Join Date
    Jun 2007
    Posts
    24

    Default Integrating 3rd Party Affiliate Tracking Software

    I'm trying to integrate 3rd party affiliate tracking software "Post Affiliate Pro 3". The software itself is great, however their support consists of deflecting me back to my shopping cart provider for assistance with integration.

    This software uses a small javascript placed on the order confirmation page to track sales figures for calculating commissions. I'm trying to make use of ORDERSUBTOTAL and ORDERNUMBER.

    Here is the Javascript that I need to update to work with ASPDNSF (ML 7.0.2.1)

    Code:
    <script id="pap3" src="http://www.yoursite.com/affiliate/scripts/sale.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    var TotalCost="XXXXXX.XX";
    var OrderID="XXXXXX";
    var ProductID="XXXXXX";
    papSale();
    --></script>
    Here is what I have done so far, (which is not working)

    1. I Created new Topic "Pap3TrackingCode" which contains the javascript (attempting to call the variables for Subtotal and Order Number.)

    Code:
    <script id="pap3" src="http://www.yoursite.com/affiliate/scripts/sale.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    var TotalCost="OrderSubtotal";
    var OrderID="OrderNumber";
    var ProductID="";
    papSale();
    --></script>
    2. I Added code to OrderConfirmation.aspx.cs to reference the Topic, using GeneralTrackingCode block as a guide, and placed immediately below it.

    Code:
    Topic Pap3TrackingCode = new Topic("Pap3TrackingCode");
    if (Pap3TrackingCode.Contents.Length != 0)
    {
    writer.Write(Pap3TrackingCode.Contents.Replace("(!ORDERSUBTOTAL!)", Localization.CurrencyStringForGatewayWithoutExchangeRate(ord.Total(true))).Replace("(!ORDERNUMBER!)", OrderNumber.ToString()));
    }
    The ordersubtotal and ordernumber variables are NOT being passed thru to the affiliate db. I'd really appreciate some assistance from staff or anyone with some insight or experience at this, or notice some error with my feable attempt.

    Thank you!

    -Brian

  2. #2
    seasonalsin is offline Senior Member
    Join Date
    Nov 2006
    Posts
    123

    Default

    Have you shut off the HTML editor for those topics?
    Shawn

    http://www.FirstChoiceMarine.com

    Currently 7.1 moving to MS9.3

  3. #3
    bpo is offline Junior Member
    Join Date
    Jun 2007
    Posts
    24

    Default

    No, however this does not appear to be an issue w/ scripts ok. I've also tried the script from a "file" in skins folder.

  4. #4
    Michael is offline Member
    Join Date
    May 2005
    Posts
    45

    Default Did you get PAP working?

    Brian,

    HTML Code:
    /scripts/sale.js
    The file in PAP4 is /scripts/salejs.php

    Did you ever get this working?

    Regards,
    Michael

  5. #5
    injectdigital is offline Junior Member
    Join Date
    May 2010
    Posts
    3

    Default Setting up PAP4 sales tracking

    I'm trying to configure PAP4 sales tracking and would really appreciate any instructions at all. I have located the orderconfirmation.aspx page where I assume the code needs to go but have no idea how to pass in the necessary values.

    Regards,
    Mike.

  6. #6
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    Check out the information here - depending on what all you have to insert on the page that'll probably help.

  7. #7
    injectdigital is offline Junior Member
    Join Date
    May 2010
    Posts
    3

    Default

    Well I added the code provided by PAP4 to the order confirmation page

    <script type="text/javascript">
    document.write(unescape("%3Cscript id=%27pap_x2s6df8d%27 src=%27" + (("https:" == document.location.protocol) ? "https://" : "http://") + "*****.postaffiliatepro.com/scripts/trackjs.js%27 type=%27text/javascript%27%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    PostAffTracker.setAccountId('default1');
    var sale = PostAffTracker.createSale();
    sale.setTotalCost('(!ORDERTOTAL!)');
    sale.setOrderID('(!ORDERNUMBER!)');
    PostAffTracker.register();
    </script>
    But when I viewed source after making a test purchase the values weren't passed in. The code simply looked like this

    <script type="text/javascript">
    document.write(unescape("%3Cscript id=%27pap_x2s6df8d%27 src=%27" + (("https:" == document.location.protocol) ? "https://" : "http://") + "******.postaffiliatepro.com/scripts/trackjs.js%27 type=%27text/javascript%27%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    PostAffTracker.setAccountId('default1');
    var sale = PostAffTracker.createSale();
    sale.setTotalCost('ORDERTOTAL');
    sale.setOrderID('ORDERNUMBER');
    PostAffTracker.register();
    </script>
    I am using a 3rd party payment gateway, not sure if that could be the problem however Google Ecommerce tracking seems to be working fine so that is receiving the right values somehow.

    Although I didn't see any ecommerce tracking code in the source either so i am completely stumped on this!