: Keep referrers for ecommerce tracking in mixed HTTP and HTTPS environment I use Google Analytics ecommerce:addTransaction to track the revenue after an acquisition. This works without problems, when
I use Google Analytics ecommerce:addTransaction to track the revenue after an acquisition.
This works without problems, when my site uses HTTP only.
But since I redirect the client to a SSL page during the buying process I get the payment service provider domains as referrers instead of the real referrers.
This is the Analytics code on the checkout success page:
ga('create', 'UA-*******-1', 'example.com');
ga('require', 'linkid', 'linkid.js');
ga('send', 'pageview');
ga('require', 'ecommerce', 'ecommerce.js');
ga('ecommerce:addTransaction', {
'id': '<?php echo $transaction['id']; ?>',
'affiliation': '<?php echo $transaction['affiliation']; ?>',
'revenue': '<?php echo $transaction['revenue']; ?>',
'shipping': '<?php echo $transaction['shipping']; ?>',
'tax': '<?php echo $transaction['revenue']; ?>',
'currency': 'EUR'
});
// adding items in a loop with ecommerce:addItem
ga('ecommerce:send');
The client normally lands on a normal http page. Once redirected to https the client stays on https sites. For example:
www.example.com www.example.com/order https://www.example.com/checkout domain.of.paymentprovider.example.net https://www.example.com/success
More posts by @Deb1703797
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.