1

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:

  1. http://www.example.com

  2. https://www.example.com/order

  3. https://www.example.com/checkout

  4. https://domain.of.paymentprovider.example.net

  5. https://www.example.com/success

6
  • As far as I understand your question the problem is not related to HTTP and HTTPS, which is handled by Analytics correctly, but rather the fact that there is a domain in between which is not 'yours'. In this case you should exclude referrers, see here: support.google.com/analytics/answer/2795830?hl=en
    – oliver13
    Oct 1, 2015 at 18:01
  • But this would require to exclude ALL payment provider domains that can occur. The reason I mention that it does not work in a HTTP/HTTPS environment is simply that it works when I don't redirect the client to the https pendant of my domain. So the tracking itself works, but the referrer is resetted in analytics.
    – Gerd K
    Oct 1, 2015 at 18:10
  • Not sure I understand. Steps 1, 2 and 3 should not trigger new referrers (but you seem to infer that that's actually the case?). When you get to 4 there's a new domain, this is outside of your scope and will, in step 5, be recorded as a new referral (=new session).
    – oliver13
    Oct 1, 2015 at 18:24
  • In step 1 the original referrer could be any external site. When the client is redirected back in 5 from the external domain where I sent him in 4, the original external referrer is overwritten with the domain of the payment service provider.
    – Gerd K
    Oct 1, 2015 at 18:29
  • Exactly, but why do you think this works "when I don't redirect the client to the https pendant of my domain"? With https pendant of my domain you mean the URLs under 2, 3 and basically 5 right? As far as I understand 4 is the problem. If you exclude all of these payment provider domains you should get the referrer from 1. Sorry if I'm a bit slow in understanding your question
    – oliver13
    Oct 1, 2015 at 18:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.