We recently updated a clients Piwik from some 2.1x version to 2.15 and meanwhile 2.16. Piwik is running a Magento shop with the latest MagePiwik from Adrian Speyer. And since the update to 2.15 more then 50% of all conversions which are fulfilled over PayPal Express are tracked as three visits which look similar to this scheme:
Initial visit: Customer browses the store and eventually is on a products detail page.
Second visit (only seconds later, same IP and ID): Customer creates a cart with his (correctly set) product and revenue while visiting
/paypal/express/review/ (this typically means he went from the products detail page directly to PayPal Express, filled everything necessary and came back now ready do purchase.)
Third visit (again only seconds later, still same IP and ID): Customer visits
/checkout/onepage/success/ while triggering a conversion, however this conversion has no products or revenu attached and the cart from the second visit stays as abandoned cart in the second visit.
So conversions get tracked but without any revenue which is very bad. Before the update and in a little bit under 50% of cases even now these actions of a customer using PayPal Express are tracked in just one visit where the cart is correctly marked as fulfilled conversion with its revenue.
My biggest problem right now is I wasn’t able to reproduce it myself. So when I try to follow the exact steps of a problematic visitor my own visits gets correctly tracked as one… And so far I’m not even sure were I should start looking. Is this probably a problem of MagePiwik where it’s not setting its ecommerce
_paq.push values correctly or is it more likely a problem on piwiks side itself?
Okay last update turned out to be only valid in one very specific case. Now it looks like it has something to do with
pk_campaign and it only affects those visitors coming from a link with a
pg_campaingn parameter set. The following is displayed for each of the three visits as campaign:
Visit 1: paid-test
Visit 2: paid-test - www.paypal.com
Visit 3: paid-test - www.clients-domain.com
So maybe piwik splits the visit as it thinks this are different campaigns due to the changing referrer? …
// Update 2:
The referrer seems to be the culprit. I guess piwik changed something in its referrer handling logic during the last updates. When we manually set a fix referrer via
_paq.push(['setReferrerUrl', "client-domain.com"]); it seems all visits are tracked correctly again while the campaign information form
pg_campaign is not lost. This is better than converions with no revenue but we now need a clever way to only override the referrer in case of PayPal express purchases so that we still have the real referrer information in our other visits logged as it may be valuable, too. Even better would be some kind of piwik fix
Any ideas or other input is still welcome.