Hi guys. Geoffrey at Verdant Tea here. I'm in the process of integrating iDevAffiliate on our website. Think I've followed the integration instructions from the wiki clearly. I added the following code to the end of our Receipt template:
^^receipt_only_begin^^<img style="float:left" border="0" src="https://verdanttea.com/idevaffiliate/sale.php?profile=43&idev_saleamt=^^order_total^^&idev_ordernum=^^order_id^^" width="1" height="1">^^receipt_only_end^^
Now, the thing is I also have Google Analytics tracking on the Receipt page and that was working fine until I tried to add the iDevAffiliate tracking to the template as well. I just ran a small live transaction to test the iDev installation, but it is not tracking commissions yet. Google Analytics showed the it registered the sale. I neglected to inspect the page source on the receipt page immediately after completing the transaction, but I thought I could go back and look at the receipt page via the FoxyCart admin transactions log to check the source code and see wether the iDev pixel tracker was populating transaction data correctly.
When I tried to view the receipt page via the FoxyCart transactions log, it showed up as a blank page with only the background visible. I inspected the page source and found that the receipt page was only loading up to the code right before the end of the document head tags. It looks like this (note: I've obscured our GA account # for security):
var _gaq = _gaq || ;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script'); s.parentNode.insertBefore(ga, s);
In the receipt template, the code that should follow this place in the document is this:
When I remove this GA placeholder code from the template and try to view the order receipt via the transaction log again, everything shows up just fine. Inspecting the source then, I don't see any iDev pixel tracking code at the end of the document, but it is there in the template. Now, if I add the GA placeholder code back in and remove the the iDev pixel code, the order receipt page will also appear as it should when I view it through the transaction log. But for whatever reason, these two pieces of tracking code do not seem willing to coexist in the receipt template without causing the mentioned problem. Oddly enough, the order receipt page DID appear as it should when it loaded the first time immediately after order completion, but it would not appear correctly when trying to view it again in the manner that I've mentioned.
Is there any known problem with using the ^^receipt_only_begin^^ ^^receipt_only_end^^ placeholders more than once in the receipt template? In this case, I'm trying to use it in two instances, the first before the closing head tag (for GA tracking), and the second before the closing body and html tags (for iDev tracking). Am I doing something wrong here?
Also, this is a somewhat divergent issue, but I notice on the iDevAffiliate integration wiki that an https SSL certificate for the iDev installation is only required for FoxyCart versions prior to 0.7.0. I am using FoxyCart version 0.7.2. So in my case, should the iDevAffiliate tracking code be functional if it is in http as follows?
^^receipt_only_begin^^<img style="float:left" border="0" src="http://verdanttea.com/idevaffiliate/sale.php?profile=43&idev_saleamt=^^order_total^^&idev_ordernum=^^order_id^^" width="1" height="1">^^receipt_only_end^^
I assume that my first transaction to test this didn't log the sale because I had used https in the code when there isn't actually an SSL certificate for our iDev installation. We use a Rapid SSL certificate with custom domain for our checkout process (https://secure.verdanttea.com
), which is what appears in the receipt url as well, so I assume the receipt page is secured. Is there any problem with having the iDev tracker send information to an unsecured address on the secured receipt page? Is there anything else I need to keep in mind here? I just want to make sure I can get this right before I try more live transactions to test it.
Any assistance on these matters would be deeply appreciated. Thanks!