Mobile app version of vmapp.org
Login or Join
Margaret670

: Google Analytics cookie across SagePay checkout We use SagePay's Server integration for our online payments. We use Google Analytics to track activity on our website and Google Ecommerce tracking

@Margaret670

Posted in: #Cookie #Ecommerce #GoogleAnalytics #Javascript #Payments

We use SagePay's Server integration for our online payments. We use Google Analytics to track activity on our website and Google Ecommerce tracking to log transactions.

In Google Analytics, under the Ecommerce view, it shows direct/none for source/medium, as the 1st party cookie is lost when visiting the external SagePay checkout pages before the customer is redirected to my confirmation page which tracks the transaction.

In all the answers I have viewed when searching for a solution, the suggestion is to alter the tracking code to read


_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);


but this needs to be implemented on all pages, including 3rd party domains (SagePay). As SagePay don't allow javascript in their template customisation, what can I do? Is there another way?

Edit:

I just found this code:


var pageTracker = _gat._getTracker('UA-XXXXX-X');
pageTracker._setCampNameKey('ga_campaign'); // name
pageTracker._setCampMediumKey('ga_medium'); // medium
pageTracker._setCampSourceKey('ga_source'); // source
pageTracker._setCampNOKey('ga_nooverride'); // don't override
pageTracker._trackPageview();


Could I store pre-checkout values for source/campaign/medium to a cookie and the retrieve it post-checkout into the code above, or would this start a new tracking session?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Margaret670

1 Comments

Sorted by latest first Latest Oldest Best

 

@Lee4591628

One alternative option could solve your tracking issue and yield a smoother user experience: inFrame integration.

Sage Pay allow you to customise/skin their payment pages and load them within an iFrame on your own website. Customers never leave your own URL, so tracking carries on like normal. Plus, customers feel like they never leave your website whilst Sage Pay still handle all transactional functionality.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme