Hi,
I recently installed Piwik to a small site I am running and had a question about the Ecommerce API. From the documentation:
http://piwik.org/docs/ecommerce-analytics/
We are instructed to call the 2 methods on the Order completion page of our ecommerce site:
addEcommerceItem(productSKU, productName, productCategory, price, quantity)
trackEcommerceOrder(orderId, grandTotal, subTotal, tax, shipping, discount)
with “_paq.push([‘trackPageView’]);” to be included in the Order confirmation page.
I have a question for the following scenario:
I have affiliate links on my site that link my customers away from my site to other vendor sites who handle order fulfillment. I want to add an Javascript event handler to the “click” event for the element that sends the customer to the vendor and have my code call addEcommerceItem and trackEcommerceOrder before they are redirected. Do these method calls get handled asynchronously or synchronously, i.e. will it register the order before they are redirected to the vendor? If it is synchronous I know it should but I am not sure what exactly happens after the push method is called on the array.
Thanks in advance,
Miguel